home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Hardware / PowerManager DDK 1.0f1 / Interfaces&Libraries / Interfaces / Quickdraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-08  |  82.4 KB  |  2,626 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Quickdraw.h
  3.  
  4.      Contains:    Interface to Quickdraw Graphics
  5.  
  6.      Version:    Mac OS 8.5
  7.  
  8.      DRI:        john calhoun
  9.  
  10.      Copyright:    © 1985-1999 by Apple Computer, Inc., all rights reserved
  11.  
  12.      Warning:    *** APPLE INTERNAL USE ONLY ***
  13.                  This file may contain unreleased API's
  14.  
  15.      BuildInfo:    Built by:            Scott Johnson
  16.                  On:                    10/8/99 11:27 AM
  17.                  With Interfacer:    3.0d13   (MPW PowerPC)
  18.                  From:                Quickdraw.i
  19.                      Revision:        123
  20.                      Dated:            5/26/99
  21.                      Last change by:    edv
  22.                      Last comment:    Move Lock/UnlockPortbits outside of conditional.
  23.  
  24.      Bugs:        Report bugs to Radar component "System Interfaces", "Latest"
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __QUICKDRAW__
  29. #define __QUICKDRAW__
  30.  
  31. #ifndef __COMPONENTS__
  32. #include <Components.h>
  33. #endif
  34.  
  35. #ifndef __MACTYPES__
  36. #include <MacTypes.h>
  37. #endif
  38.  
  39. #ifndef __MIXEDMODE__
  40. #include <MixedMode.h>
  41. #endif
  42.  
  43. #ifndef __QUICKDRAWTEXT__
  44. #include <QuickdrawText.h>
  45. #endif
  46.  
  47.  
  48.  
  49.  
  50. #if PRAGMA_ONCE
  51. #pragma once
  52. #endif
  53.  
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57.  
  58. #if PRAGMA_IMPORT
  59. #pragma import on
  60. #endif
  61.  
  62. #if PRAGMA_STRUCT_ALIGN
  63.     #pragma options align=mac68k
  64. #elif PRAGMA_STRUCT_PACKPUSH
  65.     #pragma pack(push, 2)
  66. #elif PRAGMA_STRUCT_PACK
  67.     #pragma pack(2)
  68. #endif
  69.  
  70. enum {
  71.     invalColReq                    = -1                            /*invalid color table request*/
  72. };
  73.  
  74. enum {
  75.                                                                 /* transfer modes */
  76.     srcCopy                        = 0,                            /*the 16 transfer modes*/
  77.     srcOr                        = 1,
  78.     srcXor                        = 2,
  79.     srcBic                        = 3,
  80.     notSrcCopy                    = 4,
  81.     notSrcOr                    = 5,
  82.     notSrcXor                    = 6,
  83.     notSrcBic                    = 7,
  84.     patCopy                        = 8,
  85.     patOr                        = 9,
  86.     patXor                        = 10,
  87.     patBic                        = 11,
  88.     notPatCopy                    = 12,
  89.     notPatOr                    = 13,
  90.     notPatXor                    = 14,
  91.     notPatBic                    = 15,                            /* Special Text Transfer Mode */
  92.     grayishTextOr                = 49,
  93.     hilitetransfermode            = 50,
  94.     hilite                        = 50,                            /* Arithmetic transfer modes */
  95.     blend                        = 32,
  96.     addPin                        = 33,
  97.     addOver                        = 34,
  98.     subPin                        = 35,
  99.     addMax                        = 37,
  100.     adMax                        = 37,
  101.     subOver                        = 38,
  102.     adMin                        = 39,
  103.     ditherCopy                    = 64,                            /* Transparent mode constant */
  104.     transparent                    = 36
  105. };
  106.  
  107. enum {
  108.     italicBit                    = 1,
  109.     ulineBit                    = 2,
  110.     outlineBit                    = 3,
  111.     shadowBit                    = 4,
  112.     condenseBit                    = 5,
  113.     extendBit                    = 6
  114. };
  115.  
  116. enum {
  117.                                                                 /* QuickDraw color separation constants */
  118.     normalBit                    = 0,                            /*normal screen mapping*/
  119.     inverseBit                    = 1,                            /*inverse screen mapping*/
  120.     redBit                        = 4,                            /*RGB additive mapping*/
  121.     greenBit                    = 3,
  122.     blueBit                        = 2,
  123.     cyanBit                        = 8,                            /*CMYBk subtractive mapping*/
  124.     magentaBit                    = 7,
  125.     yellowBit                    = 6,
  126.     blackBit                    = 5
  127. };
  128.  
  129. enum {
  130.     blackColor                    = 33,                            /*colors expressed in these mappings*/
  131.     whiteColor                    = 30,
  132.     redColor                    = 205,
  133.     greenColor                    = 341,
  134.     blueColor                    = 409,
  135.     cyanColor                    = 273,
  136.     magentaColor                = 137,
  137.     yellowColor                    = 69
  138. };
  139.  
  140. enum {
  141.     picLParen                    = 0,                            /*standard picture comments*/
  142.     picRParen                    = 1,
  143.     clutType                    = 0,                            /*0 if lookup table*/
  144.     fixedType                    = 1,                            /*1 if fixed table*/
  145.     directType                    = 2,                            /*2 if direct values*/
  146.     gdDevType                    = 0                                /*0 = monochrome 1 = color*/
  147. };
  148.  
  149. enum {
  150.     interlacedDevice            = 2,                            /* 1 if single pixel lines look bad */
  151.     roundedDevice                = 5,                            /* 1 if device has been “rounded” into the GrayRgn */
  152.     hasAuxMenuBar                = 6,                            /* 1 if device has an aux menu bar on it */
  153.     burstDevice                    = 7,
  154.     ext32Device                    = 8,
  155.     ramInit                        = 10,                            /*1 if initialized from 'scrn' resource*/
  156.     mainScreen                    = 11,                            /* 1 if main screen */
  157.     allInit                        = 12,                            /* 1 if all devices initialized */
  158.     screenDevice                = 13,                            /*1 if screen device [not used]*/
  159.     noDriver                    = 14,                            /* 1 if no driver for this GDevice */
  160.     screenActive                = 15,                            /*1 if in use*/
  161.     hiliteBit                    = 7,                            /*flag bit in HiliteMode (lowMem flag)*/
  162.     pHiliteBit                    = 0,                            /*flag bit in HiliteMode used with BitClr procedure*/
  163.     defQDColors                    = 127,                            /*resource ID of clut for default QDColors*/
  164.                                                                 /* pixel type */
  165.     RGBDirect                    = 16,                            /* 16 & 32 bits/pixel pixelType value */
  166.                                                                 /* pmVersion values */
  167.     baseAddr32                    = 4                                /*pixmap base address is 32-bit address*/
  168. };
  169.  
  170.  
  171. enum {
  172.     sysPatListID                = 0,
  173.     iBeamCursor                    = 1,
  174.     crossCursor                    = 2,
  175.     plusCursor                    = 3,
  176.     watchCursor                    = 4
  177. };
  178.  
  179. enum {
  180.     kQDGrafVerbFrame            = 0,
  181.     kQDGrafVerbPaint            = 1,
  182.     kQDGrafVerbErase            = 2,
  183.     kQDGrafVerbInvert            = 3,
  184.     kQDGrafVerbFill                = 4
  185. };
  186.  
  187. #if OLDROUTINENAMES
  188. enum {
  189.     frame                        = kQDGrafVerbFrame,
  190.     paint                        = kQDGrafVerbPaint,
  191.     erase                        = kQDGrafVerbErase,
  192.     invert                        = kQDGrafVerbInvert,
  193.     fill                        = kQDGrafVerbFill
  194. };
  195.  
  196. #endif  /* OLDROUTINENAMES */
  197.  
  198. typedef SInt8                             GrafVerb;
  199. enum {
  200.     chunky                        = 0,
  201.     chunkyPlanar                = 1,
  202.     planar                        = 2
  203. };
  204.  
  205. typedef SInt8                             PixelType;
  206. typedef short                             Bits16[16];
  207.  
  208. /***************   IMPORTANT NOTE REGARDING Pattern  **************************************
  209.    Patterns were originally defined as:
  210.    
  211.         C:             typedef unsigned char Pattern[8];
  212.         Pascal:        Pattern = PACKED ARRAY [0..7] OF 0..255;
  213.         
  214.    The old array definition of Pattern would cause 68000 based CPU's to crash in certain circum-
  215.    stances. The new struct definition is safe, but may require source code changes to compile.
  216.     
  217. *********************************************************************************************/
  218.  
  219. struct Pattern {
  220.     UInt8                             pat[8];
  221. };
  222. typedef struct Pattern                    Pattern;
  223. /*
  224.  ConstPatternParam is no longer needed.  It was first created when Pattern was an array.
  225.  Now that Pattern is a struct, it is more straight forward to just add the "const" qualifier
  226.  on the parameter type (e.g. "const Pattern * pat" instead of "ConstPatternParam pat").
  227. */
  228.  
  229. typedef const Pattern *                    ConstPatternParam;
  230. typedef Pattern *                        PatPtr;
  231. typedef PatPtr *                        PatHandle;
  232. typedef SignedByte                         QDByte;
  233. typedef QDByte *                        QDPtr;
  234. typedef QDPtr *                            QDHandle;
  235. typedef short                             QDErr;
  236. enum {
  237.     singleDevicesBit            = 0,
  238.     dontMatchSeedsBit            = 1,
  239.     allDevicesBit                = 2
  240. };
  241.  
  242. enum {
  243.     singleDevices                = 1 << singleDevicesBit,
  244.     dontMatchSeeds                = 1 << dontMatchSeedsBit,
  245.     allDevices                    = 1 << allDevicesBit
  246. };
  247.  
  248. typedef unsigned long                     DeviceLoopFlags;
  249. /*
  250.     PrinterStatusOpcode.  For communication with downloading and printing services.
  251. */
  252. typedef SInt32                             PrinterStatusOpcode;
  253. enum {
  254.     kPrinterFontStatus            = 0,
  255.     kPrinterScalingStatus        = 1
  256. };
  257.  
  258.  
  259. struct PrinterFontStatus {
  260.     SInt32                             oResult;
  261.     SInt16                             iFondID;
  262.     Style                             iStyle;
  263. };
  264. typedef struct PrinterFontStatus        PrinterFontStatus;
  265.  
  266. struct PrinterScalingStatus {
  267.     Point                             oScalingFactors;
  268. };
  269. typedef struct PrinterScalingStatus        PrinterScalingStatus;
  270.  
  271. struct BitMap {
  272.     Ptr                             baseAddr;
  273.     short                             rowBytes;
  274.     Rect                             bounds;
  275. };
  276. typedef struct BitMap                    BitMap;
  277. typedef BitMap *                        BitMapPtr;
  278. typedef BitMapPtr *                        BitMapHandle;
  279.  
  280. struct Cursor {
  281.     Bits16                             data;
  282.     Bits16                             mask;
  283.     Point                             hotSpot;
  284. };
  285. typedef struct Cursor                    Cursor;
  286.  
  287. typedef Cursor *                        CursPtr;
  288. typedef CursPtr *                        CursHandle;
  289.  
  290. struct PenState {
  291.     Point                             pnLoc;
  292.     Point                             pnSize;
  293.     short                             pnMode;
  294.     Pattern                         pnPat;
  295. };
  296. typedef struct PenState                    PenState;
  297. #if !OPAQUE_TOOLBOX_STRUCTS
  298.  
  299. struct MacRegion {
  300.     unsigned short                     rgnSize;                    /*size in bytes*/
  301.     Rect                             rgnBBox;                    /*enclosing rectangle*/
  302. };
  303. typedef struct MacRegion                MacRegion;
  304. /*
  305.     The type name "Region" has a name space collision on Win32.
  306.     Use MacRegion to be cross-platfrom safe.
  307. */
  308. #if TARGET_OS_MAC
  309.  
  310. typedef MacRegion                         Region;
  311. #endif  /* TARGET_OS_MAC */
  312.  
  313. typedef MacRegion *                        RgnPtr;
  314. typedef RgnPtr *                        RgnHandle;
  315. #else
  316. typedef struct OpaqueRgnHandle*         RgnHandle;
  317. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  318.  
  319.  
  320. struct Picture {
  321.     short                             picSize;
  322.     Rect                             picFrame;
  323. };
  324. typedef struct Picture                    Picture;
  325.  
  326. typedef Picture *                        PicPtr;
  327. typedef PicPtr *                        PicHandle;
  328.  
  329. struct MacPolygon {
  330.     short                             polySize;
  331.     Rect                             polyBBox;
  332.     Point                             polyPoints[1];
  333. };
  334. typedef struct MacPolygon                MacPolygon;
  335. /*
  336.     The type name "Polygon" has a name space collision on Win32.
  337.     Use MacPolygon to be cross-platfrom safe.
  338. */
  339. #if TARGET_OS_MAC
  340.  
  341. typedef MacPolygon                         Polygon;
  342. #endif  /* TARGET_OS_MAC */
  343.  
  344. typedef MacPolygon *                    PolyPtr;
  345. typedef PolyPtr *                        PolyHandle;
  346. typedef CALLBACK_API( void , QDTextProcPtr )(short byteCount, Ptr textBuf, Point numer, Point denom);
  347. typedef CALLBACK_API( void , QDLineProcPtr )(Point newPt);
  348. typedef CALLBACK_API( void , QDRectProcPtr )(GrafVerb verb, Rect *r);
  349. typedef CALLBACK_API( void , QDRRectProcPtr )(GrafVerb verb, Rect *r, short ovalWidth, short ovalHeight);
  350. typedef CALLBACK_API( void , QDOvalProcPtr )(GrafVerb verb, Rect *r);
  351. typedef CALLBACK_API( void , QDArcProcPtr )(GrafVerb verb, Rect *r, short startAngle, short arcAngle);
  352. typedef CALLBACK_API( void , QDPolyProcPtr )(GrafVerb verb, PolyHandle poly);
  353. typedef CALLBACK_API( void , QDRgnProcPtr )(GrafVerb verb, RgnHandle rgn);
  354. typedef CALLBACK_API( void , QDBitsProcPtr )(BitMap *srcBits, Rect *srcRect, Rect *dstRect, short mode, RgnHandle maskRgn);
  355. typedef CALLBACK_API( void , QDCommentProcPtr )(short kind, short dataSize, Handle dataHandle);
  356. typedef CALLBACK_API( short , QDTxMeasProcPtr )(short byteCount, Ptr textAddr, Point *numer, Point *denom, FontInfo *info);
  357. typedef CALLBACK_API( void , QDGetPicProcPtr )(Ptr dataPtr, short byteCount);
  358. typedef CALLBACK_API( void , QDPutPicProcPtr )(Ptr dataPtr, short byteCount);
  359. typedef CALLBACK_API( void , QDOpcodeProcPtr )(Rect *fromRect, Rect *toRect, short opcode, short version);
  360. typedef CALLBACK_API_C( OSStatus , QDStdGlyphsProcPtr )(void *dataStream, ByteCount size);
  361. typedef CALLBACK_API( void , QDJShieldCursorProcPtr )(short left, short top, short right, short bottom);
  362. typedef STACK_UPP_TYPE(QDTextProcPtr)                             QDTextUPP;
  363. typedef STACK_UPP_TYPE(QDLineProcPtr)                             QDLineUPP;
  364. typedef STACK_UPP_TYPE(QDRectProcPtr)                             QDRectUPP;
  365. typedef STACK_UPP_TYPE(QDRRectProcPtr)                             QDRRectUPP;
  366. typedef STACK_UPP_TYPE(QDOvalProcPtr)                             QDOvalUPP;
  367. typedef STACK_UPP_TYPE(QDArcProcPtr)                             QDArcUPP;
  368. typedef STACK_UPP_TYPE(QDPolyProcPtr)                             QDPolyUPP;
  369. typedef STACK_UPP_TYPE(QDRgnProcPtr)                             QDRgnUPP;
  370. typedef STACK_UPP_TYPE(QDBitsProcPtr)                             QDBitsUPP;
  371. typedef STACK_UPP_TYPE(QDCommentProcPtr)                         QDCommentUPP;
  372. typedef STACK_UPP_TYPE(QDTxMeasProcPtr)                         QDTxMeasUPP;
  373. typedef STACK_UPP_TYPE(QDGetPicProcPtr)                         QDGetPicUPP;
  374. typedef STACK_UPP_TYPE(QDPutPicProcPtr)                         QDPutPicUPP;
  375. typedef STACK_UPP_TYPE(QDOpcodeProcPtr)                         QDOpcodeUPP;
  376. typedef STACK_UPP_TYPE(QDStdGlyphsProcPtr)                         QDStdGlyphsUPP;
  377. typedef STACK_UPP_TYPE(QDJShieldCursorProcPtr)                     QDJShieldCursorUPP;
  378.  
  379. struct QDProcs {
  380.     QDTextUPP                         textProc;
  381.     QDLineUPP                         lineProc;
  382.     QDRectUPP                         rectProc;
  383.     QDRRectUPP                         rRectProc;
  384.     QDOvalUPP                         ovalProc;
  385.     QDArcUPP                         arcProc;
  386.     QDPolyUPP                         polyProc;
  387.     QDRgnUPP                         rgnProc;
  388.     QDBitsUPP                         bitsProc;
  389.     QDCommentUPP                     commentProc;
  390.     QDTxMeasUPP                     txMeasProc;
  391.     QDGetPicUPP                     getPicProc;
  392.     QDPutPicUPP                     putPicProc;
  393. };
  394. typedef struct QDProcs                    QDProcs;
  395. typedef QDProcs *                        QDProcsPtr;
  396. #if OPAQUE_UPP_TYPES
  397.     EXTERN_API(QDTextUPP)
  398.     NewQDTextUPP                   (QDTextProcPtr            userRoutine);
  399.  
  400.     EXTERN_API(QDLineUPP)
  401.     NewQDLineUPP                   (QDLineProcPtr            userRoutine);
  402.  
  403.     EXTERN_API(QDRectUPP)
  404.     NewQDRectUPP                   (QDRectProcPtr            userRoutine);
  405.  
  406.     EXTERN_API(QDRRectUPP)
  407.     NewQDRRectUPP                   (QDRRectProcPtr            userRoutine);
  408.  
  409.     EXTERN_API(QDOvalUPP)
  410.     NewQDOvalUPP                   (QDOvalProcPtr            userRoutine);
  411.  
  412.     EXTERN_API(QDArcUPP)
  413.     NewQDArcUPP                       (QDArcProcPtr            userRoutine);
  414.  
  415.     EXTERN_API(QDPolyUPP)
  416.     NewQDPolyUPP                   (QDPolyProcPtr            userRoutine);
  417.  
  418.     EXTERN_API(QDRgnUPP)
  419.     NewQDRgnUPP                       (QDRgnProcPtr            userRoutine);
  420.  
  421.     EXTERN_API(QDBitsUPP)
  422.     NewQDBitsUPP                   (QDBitsProcPtr            userRoutine);
  423.  
  424.     EXTERN_API(QDCommentUPP)
  425.     NewQDCommentUPP                   (QDCommentProcPtr        userRoutine);
  426.  
  427.     EXTERN_API(QDTxMeasUPP)
  428.     NewQDTxMeasUPP                   (QDTxMeasProcPtr            userRoutine);
  429.  
  430.     EXTERN_API(QDGetPicUPP)
  431.     NewQDGetPicUPP                   (QDGetPicProcPtr            userRoutine);
  432.  
  433.     EXTERN_API(QDPutPicUPP)
  434.     NewQDPutPicUPP                   (QDPutPicProcPtr            userRoutine);
  435.  
  436.     EXTERN_API(QDOpcodeUPP)
  437.     NewQDOpcodeUPP                   (QDOpcodeProcPtr            userRoutine);
  438.  
  439.     EXTERN_API(QDStdGlyphsUPP)
  440.     NewQDStdGlyphsUPP               (QDStdGlyphsProcPtr        userRoutine);
  441.  
  442.     EXTERN_API(QDJShieldCursorUPP)
  443.     NewQDJShieldCursorUPP           (QDJShieldCursorProcPtr    userRoutine);
  444.  
  445.     EXTERN_API(void)
  446.     DisposeQDTextUPP               (QDTextUPP                userUPP);
  447.  
  448.     EXTERN_API(void)
  449.     DisposeQDLineUPP               (QDLineUPP                userUPP);
  450.  
  451.     EXTERN_API(void)
  452.     DisposeQDRectUPP               (QDRectUPP                userUPP);
  453.  
  454.     EXTERN_API(void)
  455.     DisposeQDRRectUPP               (QDRRectUPP                userUPP);
  456.  
  457.     EXTERN_API(void)
  458.     DisposeQDOvalUPP               (QDOvalUPP                userUPP);
  459.  
  460.     EXTERN_API(void)
  461.     DisposeQDArcUPP                   (QDArcUPP                userUPP);
  462.  
  463.     EXTERN_API(void)
  464.     DisposeQDPolyUPP               (QDPolyUPP                userUPP);
  465.  
  466.     EXTERN_API(void)
  467.     DisposeQDRgnUPP                   (QDRgnUPP                userUPP);
  468.  
  469.     EXTERN_API(void)
  470.     DisposeQDBitsUPP               (QDBitsUPP                userUPP);
  471.  
  472.     EXTERN_API(void)
  473.     DisposeQDCommentUPP               (QDCommentUPP            userUPP);
  474.  
  475.     EXTERN_API(void)
  476.     DisposeQDTxMeasUPP               (QDTxMeasUPP                userUPP);
  477.  
  478.     EXTERN_API(void)
  479.     DisposeQDGetPicUPP               (QDGetPicUPP                userUPP);
  480.  
  481.     EXTERN_API(void)
  482.     DisposeQDPutPicUPP               (QDPutPicUPP                userUPP);
  483.  
  484.     EXTERN_API(void)
  485.     DisposeQDOpcodeUPP               (QDOpcodeUPP                userUPP);
  486.  
  487.     EXTERN_API(void)
  488.     DisposeQDStdGlyphsUPP           (QDStdGlyphsUPP            userUPP);
  489.  
  490.     EXTERN_API(void)
  491.     DisposeQDJShieldCursorUPP       (QDJShieldCursorUPP        userUPP);
  492.  
  493.     EXTERN_API(void)
  494.     InvokeQDTextUPP                   (short                    byteCount,
  495.                                     Ptr                        textBuf,
  496.                                     Point                    numer,
  497.                                     Point                    denom,
  498.                                     QDTextUPP                userUPP);
  499.  
  500.     EXTERN_API(void)
  501.     InvokeQDLineUPP                   (Point                    newPt,
  502.                                     QDLineUPP                userUPP);
  503.  
  504.     EXTERN_API(void)
  505.     InvokeQDRectUPP                   (GrafVerb                verb,
  506.                                     Rect *                    r,
  507.                                     QDRectUPP                userUPP);
  508.  
  509.     EXTERN_API(void)
  510.     InvokeQDRRectUPP               (GrafVerb                verb,
  511.                                     Rect *                    r,
  512.                                     short                    ovalWidth,
  513.                                     short                    ovalHeight,
  514.                                     QDRRectUPP                userUPP);
  515.  
  516.     EXTERN_API(void)
  517.     InvokeQDOvalUPP                   (GrafVerb                verb,
  518.                                     Rect *                    r,
  519.                                     QDOvalUPP                userUPP);
  520.  
  521.     EXTERN_API(void)
  522.     InvokeQDArcUPP                   (GrafVerb                verb,
  523.                                     Rect *                    r,
  524.                                     short                    startAngle,
  525.                                     short                    arcAngle,
  526.                                     QDArcUPP                userUPP);
  527.  
  528.     EXTERN_API(void)
  529.     InvokeQDPolyUPP                   (GrafVerb                verb,
  530.                                     PolyHandle                poly,
  531.                                     QDPolyUPP                userUPP);
  532.  
  533.     EXTERN_API(void)
  534.     InvokeQDRgnUPP                   (GrafVerb                verb,
  535.                                     RgnHandle                rgn,
  536.                                     QDRgnUPP                userUPP);
  537.  
  538.     EXTERN_API(void)
  539.     InvokeQDBitsUPP                   (BitMap *                srcBits,
  540.                                     Rect *                    srcRect,
  541.                                     Rect *                    dstRect,
  542.                                     short                    mode,
  543.                                     RgnHandle                maskRgn,
  544.                                     QDBitsUPP                userUPP);
  545.  
  546.     EXTERN_API(void)
  547.     InvokeQDCommentUPP               (short                    kind,
  548.                                     short                    dataSize,
  549.                                     Handle                    dataHandle,
  550.                                     QDCommentUPP            userUPP);
  551.  
  552.     EXTERN_API(short)
  553.     InvokeQDTxMeasUPP               (short                    byteCount,
  554.                                     Ptr                        textAddr,
  555.                                     Point *                    numer,
  556.                                     Point *                    denom,
  557.                                     FontInfo *                info,
  558.                                     QDTxMeasUPP                userUPP);
  559.  
  560.     EXTERN_API(void)
  561.     InvokeQDGetPicUPP               (Ptr                        dataPtr,
  562.                                     short                    byteCount,
  563.                                     QDGetPicUPP                userUPP);
  564.  
  565.     EXTERN_API(void)
  566.     InvokeQDPutPicUPP               (Ptr                        dataPtr,
  567.                                     short                    byteCount,
  568.                                     QDPutPicUPP                userUPP);
  569.  
  570.     EXTERN_API(void)
  571.     InvokeQDOpcodeUPP               (Rect *                    fromRect,
  572.                                     Rect *                    toRect,
  573.                                     short                    opcode,
  574.                                     short                    version,
  575.                                     QDOpcodeUPP                userUPP);
  576.  
  577.     EXTERN_API(OSStatus)
  578.     InvokeQDStdGlyphsUPP           (void *                    dataStream,
  579.                                     ByteCount                size,
  580.                                     QDStdGlyphsUPP            userUPP);
  581.  
  582.     EXTERN_API(void)
  583.     InvokeQDJShieldCursorUPP       (short                    left,
  584.                                     short                    top,
  585.                                     short                    right,
  586.                                     short                    bottom,
  587.                                     QDJShieldCursorUPP        userUPP);
  588.  
  589. #else
  590.     enum { uppQDTextProcInfo = 0x00003F80 };                         /* pascal no_return_value Func(2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  591.     enum { uppQDLineProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  592.     enum { uppQDRectProcInfo = 0x00000340 };                         /* pascal no_return_value Func(1_byte, 4_bytes) */
  593.     enum { uppQDRRectProcInfo = 0x00002B40 };                         /* pascal no_return_value Func(1_byte, 4_bytes, 2_bytes, 2_bytes) */
  594.     enum { uppQDOvalProcInfo = 0x00000340 };                         /* pascal no_return_value Func(1_byte, 4_bytes) */
  595.     enum { uppQDArcProcInfo = 0x00002B40 };                         /* pascal no_return_value Func(1_byte, 4_bytes, 2_bytes, 2_bytes) */
  596.     enum { uppQDPolyProcInfo = 0x00000340 };                         /* pascal no_return_value Func(1_byte, 4_bytes) */
  597.     enum { uppQDRgnProcInfo = 0x00000340 };                         /* pascal no_return_value Func(1_byte, 4_bytes) */
  598.     enum { uppQDBitsProcInfo = 0x0000EFC0 };                         /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 2_bytes, 4_bytes) */
  599.     enum { uppQDCommentProcInfo = 0x00000E80 };                     /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes) */
  600.     enum { uppQDTxMeasProcInfo = 0x0000FFA0 };                         /* pascal 2_bytes Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  601.     enum { uppQDGetPicProcInfo = 0x000002C0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes) */
  602.     enum { uppQDPutPicProcInfo = 0x000002C0 };                         /* pascal no_return_value Func(4_bytes, 2_bytes) */
  603.     enum { uppQDOpcodeProcInfo = 0x00002BC0 };                         /* pascal no_return_value Func(4_bytes, 4_bytes, 2_bytes, 2_bytes) */
  604.     enum { uppQDStdGlyphsProcInfo = 0x000003F1 };                     /* 4_bytes Func(4_bytes, 4_bytes) */
  605.     enum { uppQDJShieldCursorProcInfo = 0x00002A80 };                 /* pascal no_return_value Func(2_bytes, 2_bytes, 2_bytes, 2_bytes) */
  606.     #define NewQDTextUPP(userRoutine)                                 (QDTextUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDTextProcInfo, GetCurrentArchitecture())
  607.     #define NewQDLineUPP(userRoutine)                                 (QDLineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDLineProcInfo, GetCurrentArchitecture())
  608.     #define NewQDRectUPP(userRoutine)                                 (QDRectUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRectProcInfo, GetCurrentArchitecture())
  609.     #define NewQDRRectUPP(userRoutine)                                 (QDRRectUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRRectProcInfo, GetCurrentArchitecture())
  610.     #define NewQDOvalUPP(userRoutine)                                 (QDOvalUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDOvalProcInfo, GetCurrentArchitecture())
  611.     #define NewQDArcUPP(userRoutine)                                 (QDArcUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDArcProcInfo, GetCurrentArchitecture())
  612.     #define NewQDPolyUPP(userRoutine)                                 (QDPolyUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDPolyProcInfo, GetCurrentArchitecture())
  613.     #define NewQDRgnUPP(userRoutine)                                 (QDRgnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDRgnProcInfo, GetCurrentArchitecture())
  614.     #define NewQDBitsUPP(userRoutine)                                 (QDBitsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDBitsProcInfo, GetCurrentArchitecture())
  615.     #define NewQDCommentUPP(userRoutine)                             (QDCommentUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDCommentProcInfo, GetCurrentArchitecture())
  616.     #define NewQDTxMeasUPP(userRoutine)                             (QDTxMeasUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDTxMeasProcInfo, GetCurrentArchitecture())
  617.     #define NewQDGetPicUPP(userRoutine)                             (QDGetPicUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDGetPicProcInfo, GetCurrentArchitecture())
  618.     #define NewQDPutPicUPP(userRoutine)                             (QDPutPicUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDPutPicProcInfo, GetCurrentArchitecture())
  619.     #define NewQDOpcodeUPP(userRoutine)                             (QDOpcodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDOpcodeProcInfo, GetCurrentArchitecture())
  620.     #define NewQDStdGlyphsUPP(userRoutine)                             (QDStdGlyphsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDStdGlyphsProcInfo, GetCurrentArchitecture())
  621.     #define NewQDJShieldCursorUPP(userRoutine)                         (QDJShieldCursorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQDJShieldCursorProcInfo, GetCurrentArchitecture())
  622.     #define DisposeQDTextUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  623.     #define DisposeQDLineUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  624.     #define DisposeQDRectUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  625.     #define DisposeQDRRectUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  626.     #define DisposeQDOvalUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  627.     #define DisposeQDArcUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  628.     #define DisposeQDPolyUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  629.     #define DisposeQDRgnUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  630.     #define DisposeQDBitsUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  631.     #define DisposeQDCommentUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  632.     #define DisposeQDTxMeasUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  633.     #define DisposeQDGetPicUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  634.     #define DisposeQDPutPicUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  635.     #define DisposeQDOpcodeUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  636.     #define DisposeQDStdGlyphsUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  637.     #define DisposeQDJShieldCursorUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  638.     #define InvokeQDTextUPP(byteCount, textBuf, numer, denom, userUPP)  CALL_FOUR_PARAMETER_UPP((userUPP), uppQDTextProcInfo, (byteCount), (textBuf), (numer), (denom))
  639.     #define InvokeQDLineUPP(newPt, userUPP)                         CALL_ONE_PARAMETER_UPP((userUPP), uppQDLineProcInfo, (newPt))
  640.     #define InvokeQDRectUPP(verb, r, userUPP)                         CALL_TWO_PARAMETER_UPP((userUPP), uppQDRectProcInfo, (verb), (r))
  641.     #define InvokeQDRRectUPP(verb, r, ovalWidth, ovalHeight, userUPP)  CALL_FOUR_PARAMETER_UPP((userUPP), uppQDRRectProcInfo, (verb), (r), (ovalWidth), (ovalHeight))
  642.     #define InvokeQDOvalUPP(verb, r, userUPP)                         CALL_TWO_PARAMETER_UPP((userUPP), uppQDOvalProcInfo, (verb), (r))
  643.     #define InvokeQDArcUPP(verb, r, startAngle, arcAngle, userUPP)     CALL_FOUR_PARAMETER_UPP((userUPP), uppQDArcProcInfo, (verb), (r), (startAngle), (arcAngle))
  644.     #define InvokeQDPolyUPP(verb, poly, userUPP)                     CALL_TWO_PARAMETER_UPP((userUPP), uppQDPolyProcInfo, (verb), (poly))
  645.     #define InvokeQDRgnUPP(verb, rgn, userUPP)                         CALL_TWO_PARAMETER_UPP((userUPP), uppQDRgnProcInfo, (verb), (rgn))
  646.     #define InvokeQDBitsUPP(srcBits, srcRect, dstRect, mode, maskRgn, userUPP)  CALL_FIVE_PARAMETER_UPP((userUPP), uppQDBitsProcInfo, (srcBits), (srcRect), (dstRect), (mode), (maskRgn))
  647.     #define InvokeQDCommentUPP(kind, dataSize, dataHandle, userUPP)  CALL_THREE_PARAMETER_UPP((userUPP), uppQDCommentProcInfo, (kind), (dataSize), (dataHandle))
  648.     #define InvokeQDTxMeasUPP(byteCount, textAddr, numer, denom, info, userUPP)  CALL_FIVE_PARAMETER_UPP((userUPP), uppQDTxMeasProcInfo, (byteCount), (textAddr), (numer), (denom), (info))
  649.     #define InvokeQDGetPicUPP(dataPtr, byteCount, userUPP)             CALL_TWO_PARAMETER_UPP((userUPP), uppQDGetPicProcInfo, (dataPtr), (byteCount))
  650.     #define InvokeQDPutPicUPP(dataPtr, byteCount, userUPP)             CALL_TWO_PARAMETER_UPP((userUPP), uppQDPutPicProcInfo, (dataPtr), (byteCount))
  651.     #define InvokeQDOpcodeUPP(fromRect, toRect, opcode, version, userUPP)  CALL_FOUR_PARAMETER_UPP((userUPP), uppQDOpcodeProcInfo, (fromRect), (toRect), (opcode), (version))
  652.     #define InvokeQDStdGlyphsUPP(dataStream, size, userUPP)         CALL_TWO_PARAMETER_UPP((userUPP), uppQDStdGlyphsProcInfo, (dataStream), (size))
  653.     #define InvokeQDJShieldCursorUPP(left, top, right, bottom, userUPP)  CALL_FOUR_PARAMETER_UPP((userUPP), uppQDJShieldCursorProcInfo, (left), (top), (right), (bottom))
  654. #endif
  655. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  656. #define NewQDTextProc(userRoutine)                                 NewQDTextUPP(userRoutine)
  657. #define NewQDLineProc(userRoutine)                                 NewQDLineUPP(userRoutine)
  658. #define NewQDRectProc(userRoutine)                                 NewQDRectUPP(userRoutine)
  659. #define NewQDRRectProc(userRoutine)                             NewQDRRectUPP(userRoutine)
  660. #define NewQDOvalProc(userRoutine)                                 NewQDOvalUPP(userRoutine)
  661. #define NewQDArcProc(userRoutine)                                 NewQDArcUPP(userRoutine)
  662. #define NewQDPolyProc(userRoutine)                                 NewQDPolyUPP(userRoutine)
  663. #define NewQDRgnProc(userRoutine)                                 NewQDRgnUPP(userRoutine)
  664. #define NewQDBitsProc(userRoutine)                                 NewQDBitsUPP(userRoutine)
  665. #define NewQDCommentProc(userRoutine)                             NewQDCommentUPP(userRoutine)
  666. #define NewQDTxMeasProc(userRoutine)                             NewQDTxMeasUPP(userRoutine)
  667. #define NewQDGetPicProc(userRoutine)                             NewQDGetPicUPP(userRoutine)
  668. #define NewQDPutPicProc(userRoutine)                             NewQDPutPicUPP(userRoutine)
  669. #define NewQDOpcodeProc(userRoutine)                             NewQDOpcodeUPP(userRoutine)
  670. #define NewQDStdGlyphsProc(userRoutine)                         NewQDStdGlyphsUPP(userRoutine)
  671. #define NewQDJShieldCursorProc(userRoutine)                     NewQDJShieldCursorUPP(userRoutine)
  672. #define CallQDTextProc(userRoutine, byteCount, textBuf, numer, denom) InvokeQDTextUPP(byteCount, textBuf, numer, denom, userRoutine)
  673. #define CallQDLineProc(userRoutine, newPt)                        InvokeQDLineUPP(newPt, userRoutine)
  674. #define CallQDRectProc(userRoutine, verb, r)                    InvokeQDRectUPP(verb, r, userRoutine)
  675. #define CallQDRRectProc(userRoutine, verb, r, ovalWidth, ovalHeight) InvokeQDRRectUPP(verb, r, ovalWidth, ovalHeight, userRoutine)
  676. #define CallQDOvalProc(userRoutine, verb, r)                    InvokeQDOvalUPP(verb, r, userRoutine)
  677. #define CallQDArcProc(userRoutine, verb, r, startAngle, arcAngle) InvokeQDArcUPP(verb, r, startAngle, arcAngle, userRoutine)
  678. #define CallQDPolyProc(userRoutine, verb, poly)                    InvokeQDPolyUPP(verb, poly, userRoutine)
  679. #define CallQDRgnProc(userRoutine, verb, rgn)                    InvokeQDRgnUPP(verb, rgn, userRoutine)
  680. #define CallQDBitsProc(userRoutine, srcBits, srcRect, dstRect, mode, maskRgn) InvokeQDBitsUPP(srcBits, srcRect, dstRect, mode, maskRgn, userRoutine)
  681. #define CallQDCommentProc(userRoutine, kind, dataSize, dataHandle) InvokeQDCommentUPP(kind, dataSize, dataHandle, userRoutine)
  682. #define CallQDTxMeasProc(userRoutine, byteCount, textAddr, numer, denom, info) InvokeQDTxMeasUPP(byteCount, textAddr, numer, denom, info, userRoutine)
  683. #define CallQDGetPicProc(userRoutine, dataPtr, byteCount)        InvokeQDGetPicUPP(dataPtr, byteCount, userRoutine)
  684. #define CallQDPutPicProc(userRoutine, dataPtr, byteCount)        InvokeQDPutPicUPP(dataPtr, byteCount, userRoutine)
  685. #define CallQDOpcodeProc(userRoutine, fromRect, toRect, opcode, version) InvokeQDOpcodeUPP(fromRect, toRect, opcode, version, userRoutine)
  686. #define CallQDStdGlyphsProc(userRoutine, dataStream, size)        InvokeQDStdGlyphsUPP(dataStream, size, userRoutine)
  687. #define CallQDJShieldCursorProc(userRoutine, left, top, right, bottom) InvokeQDJShieldCursorUPP(left, top, right, bottom, userRoutine)
  688. #if !OPAQUE_TOOLBOX_STRUCTS
  689.  
  690. struct GrafPort {
  691.     short                             device;
  692.     BitMap                             portBits;
  693.     Rect                             portRect;
  694.     RgnHandle                         visRgn;
  695.     RgnHandle                         clipRgn;
  696.     Pattern                         bkPat;
  697.     Pattern                         fillPat;
  698.     Point                             pnLoc;
  699.     Point                             pnSize;
  700.     short                             pnMode;
  701.     Pattern                         pnPat;
  702.     short                             pnVis;
  703.     short                             txFont;
  704.     StyleField                         txFace;                        /*StyleField occupies 16-bits, but only first 8-bits are used*/
  705.     short                             txMode;
  706.     short                             txSize;
  707.     Fixed                             spExtra;
  708.     long                             fgColor;
  709.     long                             bkColor;
  710.     short                             colrBit;
  711.     short                             patStretch;
  712.     Handle                             picSave;
  713.     Handle                             rgnSave;
  714.     Handle                             polySave;
  715.     QDProcsPtr                         grafProcs;
  716. };
  717. typedef struct GrafPort                    GrafPort;
  718.  
  719. typedef GrafPort *                        GrafPtr;
  720. /*
  721.  *    This set of definitions "belongs" in Windows.
  722.  *    But, there is a circularity in the headers where Windows includes Controls and
  723.  *    Controls includes Windows. To break the circle, the information
  724.  *    needed by Controls is moved from Windows to Quickdraw.
  725.  */
  726. typedef GrafPtr                         WindowPtr;
  727. typedef WindowPtr                         DialogPtr;
  728. #else
  729. typedef struct OpaqueWindowPtr*         WindowPtr;
  730. typedef struct OpaqueDialogPtr*         DialogPtr;
  731. typedef struct OpaqueGrafPtr*             GrafPtr;
  732. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  733.  
  734. typedef WindowPtr                         WindowRef;
  735. /* DragConstraint constants to pass to DragGray,DragTheRgn, or ConstrainedDragRgn*/
  736. typedef UInt16                             DragConstraint;
  737. enum {
  738.     kNoConstraint                = 0,
  739.     kVerticalConstraint            = 1,
  740.     kHorizontalConstraint        = 2
  741. };
  742.  
  743.  
  744. typedef CALLBACK_API( void , DragGrayRgnProcPtr )(void );
  745. /*
  746.  *    Here ends the list of things that "belong" in Windows.
  747.  */
  748.  
  749.  
  750.  
  751. struct RGBColor {
  752.     unsigned short                     red;                        /*magnitude of red component*/
  753.     unsigned short                     green;                        /*magnitude of green component*/
  754.     unsigned short                     blue;                        /*magnitude of blue component*/
  755. };
  756. typedef struct RGBColor                    RGBColor;
  757. typedef RGBColor *                        RGBColorPtr;
  758. typedef RGBColorPtr *                    RGBColorHdl;
  759. typedef CALLBACK_API( Boolean , ColorSearchProcPtr )(RGBColor *rgb, long *position);
  760. typedef CALLBACK_API( Boolean , ColorComplementProcPtr )(RGBColor *rgb);
  761. typedef STACK_UPP_TYPE(DragGrayRgnProcPtr)                         DragGrayRgnUPP;
  762. typedef STACK_UPP_TYPE(ColorSearchProcPtr)                         ColorSearchUPP;
  763. typedef STACK_UPP_TYPE(ColorComplementProcPtr)                     ColorComplementUPP;
  764. #if OPAQUE_UPP_TYPES
  765.     EXTERN_API(DragGrayRgnUPP)
  766.     NewDragGrayRgnUPP               (DragGrayRgnProcPtr        userRoutine);
  767.  
  768.     EXTERN_API(ColorSearchUPP)
  769.     NewColorSearchUPP               (ColorSearchProcPtr        userRoutine);
  770.  
  771.     EXTERN_API(ColorComplementUPP)
  772.     NewColorComplementUPP           (ColorComplementProcPtr    userRoutine);
  773.  
  774.     EXTERN_API(void)
  775.     DisposeDragGrayRgnUPP           (DragGrayRgnUPP            userUPP);
  776.  
  777.     EXTERN_API(void)
  778.     DisposeColorSearchUPP           (ColorSearchUPP            userUPP);
  779.  
  780.     EXTERN_API(void)
  781.     DisposeColorComplementUPP       (ColorComplementUPP        userUPP);
  782.  
  783.     EXTERN_API(void)
  784.     InvokeDragGrayRgnUPP           (DragGrayRgnUPP            userUPP);
  785.  
  786.     EXTERN_API(Boolean)
  787.     InvokeColorSearchUPP           (RGBColor *                rgb,
  788.                                     long *                    position,
  789.                                     ColorSearchUPP            userUPP);
  790.  
  791.     EXTERN_API(Boolean)
  792.     InvokeColorComplementUPP       (RGBColor *                rgb,
  793.                                     ColorComplementUPP        userUPP);
  794.  
  795. #else
  796.     enum { uppDragGrayRgnProcInfo = 0x00000000 };                     /* pascal no_return_value Func() */
  797.     enum { uppColorSearchProcInfo = 0x000003D0 };                     /* pascal 1_byte Func(4_bytes, 4_bytes) */
  798.     enum { uppColorComplementProcInfo = 0x000000D0 };                 /* pascal 1_byte Func(4_bytes) */
  799.     #define NewDragGrayRgnUPP(userRoutine)                             (DragGrayRgnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragGrayRgnProcInfo, GetCurrentArchitecture())
  800.     #define NewColorSearchUPP(userRoutine)                             (ColorSearchUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppColorSearchProcInfo, GetCurrentArchitecture())
  801.     #define NewColorComplementUPP(userRoutine)                         (ColorComplementUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppColorComplementProcInfo, GetCurrentArchitecture())
  802.     #define DisposeDragGrayRgnUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  803.     #define DisposeColorSearchUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  804.     #define DisposeColorComplementUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  805.     #define InvokeDragGrayRgnUPP(userUPP)                             CALL_ZERO_PARAMETER_UPP((userUPP), uppDragGrayRgnProcInfo)
  806.     #define InvokeColorSearchUPP(rgb, position, userUPP)             CALL_TWO_PARAMETER_UPP((userUPP), uppColorSearchProcInfo, (rgb), (position))
  807.     #define InvokeColorComplementUPP(rgb, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppColorComplementProcInfo, (rgb))
  808. #endif
  809. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  810. #define NewDragGrayRgnProc(userRoutine)                         NewDragGrayRgnUPP(userRoutine)
  811. #define NewColorSearchProc(userRoutine)                         NewColorSearchUPP(userRoutine)
  812. #define NewColorComplementProc(userRoutine)                     NewColorComplementUPP(userRoutine)
  813. #define CallDragGrayRgnProc(userRoutine)                        InvokeDragGrayRgnUPP(userRoutine)
  814. #define CallColorSearchProc(userRoutine, rgb, position)            InvokeColorSearchUPP(rgb, position, userRoutine)
  815. #define CallColorComplementProc(userRoutine, rgb)                InvokeColorComplementUPP(rgb, userRoutine)
  816.  
  817. struct ColorSpec {
  818.     short                             value;                        /*index or other value*/
  819.     RGBColor                         rgb;                        /*true color*/
  820. };
  821. typedef struct ColorSpec                ColorSpec;
  822. typedef ColorSpec *                        ColorSpecPtr;
  823.  
  824. typedef ColorSpec                         CSpecArray[1];
  825.  
  826. struct ColorTable {
  827.     long                             ctSeed;                        /*unique identifier for table*/
  828.     short                             ctFlags;                    /*high bit: 0 = PixMap; 1 = device*/
  829.     short                             ctSize;                        /*number of entries in CTTable*/
  830.     CSpecArray                         ctTable;                    /*array [0..0] of ColorSpec*/
  831. };
  832. typedef struct ColorTable                ColorTable;
  833.  
  834. typedef ColorTable *                    CTabPtr;
  835. typedef CTabPtr *                        CTabHandle;
  836.  
  837. struct xColorSpec {
  838.     short                             value;                        /*index or other value*/
  839.     RGBColor                         rgb;                        /*true color*/
  840.     short                             xalpha;
  841. };
  842. typedef struct xColorSpec                xColorSpec;
  843. typedef xColorSpec *                    xColorSpecPtr;
  844.  
  845. typedef xColorSpec                         xCSpecArray[1];
  846.  
  847. struct MatchRec {
  848.     unsigned short                     red;
  849.     unsigned short                     green;
  850.     unsigned short                     blue;
  851.     long                             matchData;
  852. };
  853. typedef struct MatchRec                    MatchRec;
  854. /*
  855.     QuickTime 3.0 makes PixMap data structure available on non-Mac OS's.
  856.     In order to implement PixMap in these alternate environments, the PixMap
  857.     had to be extended. The pmReserved field was changed to pmExt which is
  858.     a Handle to extra info.  The planeBytes field was changed to pixelFormat.
  859. */
  860. #ifndef OLDPIXMAPSTRUCT
  861. #if !(forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32)
  862. #define OLDPIXMAPSTRUCT 1
  863. #else
  864. #define OLDPIXMAPSTRUCT 0
  865. #endif  /* !(forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32) */
  866.  
  867. #endif  /* !defined(OLDPIXMAPSTRUCT) */
  868.  
  869.  
  870. #if OLDPIXMAPSTRUCT
  871.     #define GETPIXMAPPIXELFORMAT(pm)        ( (pm)->pixelSize )
  872. #else
  873.     #define GETPIXMAPPIXELFORMAT(pm)        ( ((pm)->pixelFormat != 0) ? (pm)->pixelFormat : (pm)->pixelSize )
  874. #endif
  875.  
  876.  
  877. #if !(forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32) || (NeXT && ppc)
  878.     #define NON_MAC_PIXEL_FORMATS   0
  879. #else
  880.     #define NON_MAC_PIXEL_FORMATS   1
  881. #endif
  882.  
  883. /* pixel formats*/
  884. enum {
  885.     k1MonochromePixelFormat        = 0x00000001,                    /* 1 bit indexed*/
  886.     k2IndexedPixelFormat        = 0x00000002,                    /* 2 bit indexed*/
  887.     k4IndexedPixelFormat        = 0x00000004,                    /* 4 bit indexed*/
  888.     k8IndexedPixelFormat        = 0x00000008,                    /* 8 bit indexed*/
  889.     k16BE555PixelFormat            = 0x00000010,                    /* 16 bit BE rgb 555 (Mac)*/
  890.     k24RGBPixelFormat            = 0x00000018,                    /* 24 bit rgb */
  891.     k32ARGBPixelFormat            = 0x00000020,                    /* 32 bit argb    (Mac)*/
  892.     k1IndexedGrayPixelFormat    = 0x00000021,                    /* 1 bit indexed gray*/
  893.     k2IndexedGrayPixelFormat    = 0x00000022,                    /* 2 bit indexed gray*/
  894.     k4IndexedGrayPixelFormat    = 0x00000024,                    /* 4 bit indexed gray*/
  895.     k8IndexedGrayPixelFormat    = 0x00000028                    /* 8 bit indexed gray*/
  896. };
  897.  
  898.  
  899. /* values for PixMap.pixelFormat*/
  900. enum {
  901.     k16LE555PixelFormat            = FOUR_CHAR_CODE('L555'),        /* 16 bit LE rgb 555 (PC)*/
  902.     k16LE5551PixelFormat        = FOUR_CHAR_CODE('5551'),        /* 16 bit LE rgb 5551*/
  903.     k16BE565PixelFormat            = FOUR_CHAR_CODE('B565'),        /* 16 bit BE rgb 565*/
  904.     k16LE565PixelFormat            = FOUR_CHAR_CODE('L565'),        /* 16 bit LE rgb 565*/
  905.     k24BGRPixelFormat            = FOUR_CHAR_CODE('24BG'),        /* 24 bit bgr */
  906.     k32BGRAPixelFormat            = FOUR_CHAR_CODE('BGRA'),        /* 32 bit bgra    (Matrox)*/
  907.     k32ABGRPixelFormat            = FOUR_CHAR_CODE('ABGR'),        /* 32 bit abgr    */
  908.     k32RGBAPixelFormat            = FOUR_CHAR_CODE('RGBA'),        /* 32 bit rgba    */
  909.     kYUVSPixelFormat            = FOUR_CHAR_CODE('yuvs'),        /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
  910.     kYUVUPixelFormat            = FOUR_CHAR_CODE('yuvu'),        /* YUV 4:2:2 byte ordering 16-signed*/
  911.     kYVU9PixelFormat            = FOUR_CHAR_CODE('YVU9'),        /* YVU9 Planar    9*/
  912.     kYUV411PixelFormat            = FOUR_CHAR_CODE('Y411'),        /* YUV 4:1:1 Interleaved    16*/
  913.     kYVYU422PixelFormat            = FOUR_CHAR_CODE('YVYU'),        /* YVYU 4:2:2 byte ordering    16*/
  914.     kUYVY422PixelFormat            = FOUR_CHAR_CODE('UYVY'),        /* UYVY 4:2:2 byte ordering    16*/
  915.     kYUV211PixelFormat            = FOUR_CHAR_CODE('Y211')        /* YUV 2:1:1 Packed    8*/
  916. };
  917.  
  918.  
  919.  
  920. struct PixMap {
  921.     Ptr                             baseAddr;                    /*pointer to pixels*/
  922.     short                             rowBytes;                    /*offset to next line*/
  923.     Rect                             bounds;                        /*encloses bitmap*/
  924.     short                             pmVersion;                    /*pixMap version number*/
  925.     short                             packType;                    /*defines packing format*/
  926.     long                             packSize;                    /*length of pixel data*/
  927.     Fixed                             hRes;                        /*horiz. resolution (ppi)*/
  928.     Fixed                             vRes;                        /*vert. resolution (ppi)*/
  929.     short                             pixelType;                    /*defines pixel type*/
  930.     short                             pixelSize;                    /*# bits in pixel*/
  931.     short                             cmpCount;                    /*# components in pixel*/
  932.     short                             cmpSize;                    /*# bits per component*/
  933. #if OLDPIXMAPSTRUCT
  934.     long                             planeBytes;                    /*offset to next plane*/
  935.     CTabHandle                         pmTable;                    /*color map for this pixMap*/
  936.     long                             pmReserved;
  937. #else
  938.     OSType                             pixelFormat;                /*fourCharCode representation*/
  939.     CTabHandle                         pmTable;                    /*color map for this pixMap*/
  940.     void *                            pmExt;                        /*Handle to pixMap extension*/
  941. #endif
  942. };
  943. typedef struct PixMap                    PixMap;
  944. typedef PixMap *                        PixMapPtr;
  945. typedef PixMapPtr *                        PixMapHandle;
  946.  
  947. struct PixPat {
  948.     short                             patType;                    /*type of pattern*/
  949.     PixMapHandle                     patMap;                        /*the pattern's pixMap*/
  950.     Handle                             patData;                    /*pixmap's data*/
  951.     Handle                             patXData;                    /*expanded Pattern data*/
  952.     short                             patXValid;                    /*flags whether expanded Pattern valid*/
  953.     Handle                             patXMap;                    /*Handle to expanded Pattern data*/
  954.     Pattern                         pat1Data;                    /*old-Style pattern/RGB color*/
  955. };
  956. typedef struct PixPat                    PixPat;
  957. typedef PixPat *                        PixPatPtr;
  958. typedef PixPatPtr *                        PixPatHandle;
  959.  
  960. struct CCrsr {
  961.     short                             crsrType;                    /*type of cursor*/
  962.     PixMapHandle                     crsrMap;                    /*the cursor's pixmap*/
  963.     Handle                             crsrData;                    /*cursor's data*/
  964.     Handle                             crsrXData;                    /*expanded cursor data*/
  965.     short                             crsrXValid;                    /*depth of expanded data (0 if none)*/
  966.     Handle                             crsrXHandle;                /*future use*/
  967.     Bits16                             crsr1Data;                    /*one-bit cursor*/
  968.     Bits16                             crsrMask;                    /*cursor's mask*/
  969.     Point                             crsrHotSpot;                /*cursor's hotspot*/
  970.     long                             crsrXTable;                    /*private*/
  971.     long                             crsrID;                        /*private*/
  972. };
  973. typedef struct CCrsr                    CCrsr;
  974. typedef CCrsr *                            CCrsrPtr;
  975. typedef CCrsrPtr *                        CCrsrHandle;
  976.  
  977. struct GammaTbl {
  978.     short                             gVersion;                    /*gamma version number*/
  979.     short                             gType;                        /*gamma data type*/
  980.     short                             gFormulaSize;                /*Formula data size*/
  981.     short                             gChanCnt;                    /*number of channels of data*/
  982.     short                             gDataCnt;                    /*number of values/channel*/
  983.     short                             gDataWidth;                    /*bits/corrected value (data packed to next larger byte size)*/
  984.     short                             gFormulaData[1];            /*data for formulas followed by gamma values*/
  985. };
  986. typedef struct GammaTbl                    GammaTbl;
  987. typedef GammaTbl *                        GammaTblPtr;
  988. typedef GammaTblPtr *                    GammaTblHandle;
  989.  
  990. struct ITab {
  991.     long                             iTabSeed;                    /*copy of CTSeed from source CTable*/
  992.     short                             iTabRes;                    /*bits/channel resolution of iTable*/
  993.     Byte                             iTTable[1];                    /*byte colortable index values*/
  994. };
  995. typedef struct ITab                        ITab;
  996. typedef ITab *                            ITabPtr;
  997. typedef ITabPtr *                        ITabHandle;
  998.  
  999. struct SProcRec {
  1000.     Handle                             nxtSrch;                    /*SProcHndl Handle to next SProcRec*/
  1001.     ColorSearchUPP                     srchProc;                    /*search procedure proc ptr*/
  1002. };
  1003. typedef struct SProcRec                    SProcRec;
  1004.  
  1005. typedef SProcRec *                        SProcPtr;
  1006. typedef SProcPtr *                        SProcHndl;
  1007.  
  1008. struct CProcRec {
  1009.     Handle                             nxtComp;                    /*CProcHndl Handle to next CProcRec*/
  1010.     ColorComplementUPP                 compProc;                    /*complement procedure proc ptr*/
  1011. };
  1012. typedef struct CProcRec                    CProcRec;
  1013.  
  1014. typedef CProcRec *                        CProcPtr;
  1015. typedef CProcPtr *                        CProcHndl;
  1016. /*
  1017.     QuickTime 3.0 makes GDevice data structure available on non-Mac OS's.
  1018.     In order to implement GDevice in these alternate environments, the GDevice
  1019.     had to be extended. The gdReserved field was changed to gdExt which is
  1020.     a Handle to extra info.  
  1021. */
  1022. #ifndef OLDGDEVICESTRUCT
  1023. #if !(forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32)
  1024. #define OLDGDEVICESTRUCT 1
  1025. #else
  1026. #define OLDGDEVICESTRUCT 0
  1027. #endif  /* !(forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32) */
  1028.  
  1029. #endif  /* !defined(OLDGDEVICESTRUCT) */
  1030.  
  1031. typedef struct GDevice                     GDevice;
  1032. typedef GDevice *                        GDPtr;
  1033. typedef GDPtr *                            GDHandle;
  1034.  
  1035. struct GDevice {
  1036.     short                             gdRefNum;                    /*driver's unit number*/
  1037.     short                             gdID;                        /*client ID for search procs*/
  1038.     short                             gdType;                        /*fixed/CLUT/direct*/
  1039.     ITabHandle                         gdITable;                    /*Handle to inverse lookup table*/
  1040.     short                             gdResPref;                    /*preferred resolution of GDITable*/
  1041.     SProcHndl                         gdSearchProc;                /*search proc list head*/
  1042.     CProcHndl                         gdCompProc;                    /*complement proc list*/
  1043.     short                             gdFlags;                    /*grafDevice flags word*/
  1044.     PixMapHandle                     gdPMap;                        /*describing pixMap*/
  1045.     long                             gdRefCon;                    /*reference value*/
  1046.     GDHandle                         gdNextGD;                    /*GDHandle Handle of next gDevice*/
  1047.     Rect                             gdRect;                        /* device's bounds in global coordinates*/
  1048.     long                             gdMode;                        /*device's current mode*/
  1049.     short                             gdCCBytes;                    /*depth of expanded cursor data*/
  1050.     short                             gdCCDepth;                    /*depth of expanded cursor data*/
  1051.     Handle                             gdCCXData;                    /*Handle to cursor's expanded data*/
  1052.     Handle                             gdCCXMask;                    /*Handle to cursor's expanded mask*/
  1053. #if OLDGDEVICESTRUCT
  1054.     long                             gdReserved;                    /*future use. MUST BE 0*/
  1055. #else
  1056.     Handle                             gdExt;                        /*QuickTime 3.0 private info*/
  1057. #endif
  1058. };
  1059.  
  1060.  
  1061. struct GrafVars {
  1062.     RGBColor                         rgbOpColor;                    /*color for addPin  subPin and average*/
  1063.     RGBColor                         rgbHiliteColor;                /*color for hiliting*/
  1064.     Handle                             pmFgColor;                    /*palette Handle for foreground color*/
  1065.     short                             pmFgIndex;                    /*index value for foreground*/
  1066.     Handle                             pmBkColor;                    /*palette Handle for background color*/
  1067.     short                             pmBkIndex;                    /*index value for background*/
  1068.     short                             pmFlags;                    /*flags for Palette Manager*/
  1069. };
  1070. typedef struct GrafVars                    GrafVars;
  1071.  
  1072. typedef GrafVars *                        GVarPtr;
  1073. typedef GVarPtr *                        GVarHandle;
  1074.  
  1075. #if OPAQUE_TOOLBOX_STRUCTS
  1076. typedef GrafPtr                         CGrafPtr;
  1077. #else
  1078. typedef struct CGrafPort                 CGrafPort;
  1079. typedef CGrafPort *                        CGrafPtr;
  1080. #endif  /* OPAQUE_TOOLBOX_STRUCTS */
  1081.  
  1082. typedef CALLBACK_API_C( OSStatus , QDPrinterStatusProcPtr )(PrinterStatusOpcode opcode, CGrafPtr currentPort, void *printerStatus);
  1083. typedef STACK_UPP_TYPE(QDPrinterStatusProcPtr)                     QDPrinterStatusUPP;
  1084.  
  1085.  
  1086. struct CQDProcs {
  1087.     QDTextUPP                         textProc;
  1088.     QDLineUPP                         lineProc;
  1089.     QDRectUPP                         rectProc;
  1090.     QDRRectUPP                         rRectProc;
  1091.     QDOvalUPP                         ovalProc;
  1092.     QDArcUPP                         arcProc;
  1093.     QDPolyUPP                         polyProc;
  1094.     QDRgnUPP                         rgnProc;
  1095.     QDBitsUPP                         bitsProc;
  1096.     QDCommentUPP                     commentProc;
  1097.     QDTxMeasUPP                     txMeasProc;
  1098.     QDGetPicUPP                     getPicProc;
  1099.     QDPutPicUPP                     putPicProc;
  1100.     QDOpcodeUPP                     opcodeProc;
  1101.     UniversalProcPtr                 newProc1;                    /* this is the StdPix bottleneck -- see ImageCompression.h */
  1102.     QDStdGlyphsUPP                     glyphsProc;                    /* was newProc2; now used in Unicode text drawing */
  1103.     QDPrinterStatusUPP                 printerStatusProc;            /* was newProc3;  now used to communicate status between Printing code and System imaging code */
  1104.     UniversalProcPtr                 newProc4;
  1105.     UniversalProcPtr                 newProc5;
  1106.     UniversalProcPtr                 newProc6;
  1107. };
  1108. typedef struct CQDProcs                    CQDProcs;
  1109. typedef CQDProcs *                        CQDProcsPtr;
  1110. #if !OPAQUE_TOOLBOX_STRUCTS
  1111.  
  1112. struct CGrafPort {
  1113.     short                             device;
  1114.     PixMapHandle                     portPixMap;                    /*port's pixel map*/
  1115.     short                             portVersion;                /*high 2 bits always set*/
  1116.     Handle                             grafVars;                    /*Handle to more fields*/
  1117.     short                             chExtra;                    /*character extra*/
  1118.     short                             pnLocHFrac;                    /*pen fraction*/
  1119.     Rect                             portRect;
  1120.     RgnHandle                         visRgn;
  1121.     RgnHandle                         clipRgn;
  1122.     PixPatHandle                     bkPixPat;                    /*background pattern*/
  1123.     RGBColor                         rgbFgColor;                    /*RGB components of fg*/
  1124.     RGBColor                         rgbBkColor;                    /*RGB components of bk*/
  1125.     Point                             pnLoc;
  1126.     Point                             pnSize;
  1127.     short                             pnMode;
  1128.     PixPatHandle                     pnPixPat;                    /*pen's pattern*/
  1129.     PixPatHandle                     fillPixPat;                    /*fill pattern*/
  1130.     short                             pnVis;
  1131.     short                             txFont;
  1132.     StyleField                         txFace;                        /*StyleField occupies 16-bits, but only first 8-bits are used*/
  1133.     short                             txMode;
  1134.     short                             txSize;
  1135.     Fixed                             spExtra;
  1136.     long                             fgColor;
  1137.     long                             bkColor;
  1138.     short                             colrBit;
  1139.     short                             patStretch;
  1140.     Handle                             picSave;
  1141.     Handle                             rgnSave;
  1142.     Handle                             polySave;
  1143.     CQDProcsPtr                     grafProcs;
  1144. };
  1145.  
  1146. #endif  /* !OPAQUE_TOOLBOX_STRUCTS */
  1147.  
  1148. #if OPAQUE_TOOLBOX_STRUCTS
  1149.  
  1150. typedef WindowPtr                         CWindowPtr;
  1151. #else
  1152. typedef CGrafPtr                         CWindowPtr;
  1153. #endif  /* OPAQUE_TOOLBOX_STRUCTS */
  1154.  
  1155.  
  1156. struct ReqListRec {
  1157.     short                             reqLSize;                    /*request list size*/
  1158.     short                             reqLData[1];                /*request list data*/
  1159. };
  1160. typedef struct ReqListRec                ReqListRec;
  1161.  
  1162. struct OpenCPicParams {
  1163.     Rect                             srcRect;
  1164.     Fixed                             hRes;
  1165.     Fixed                             vRes;
  1166.     short                             version;
  1167.     short                             reserved1;
  1168.     long                             reserved2;
  1169. };
  1170. typedef struct OpenCPicParams            OpenCPicParams;
  1171. enum {
  1172.     kCursorImageMajorVersion    = 0x0001,
  1173.     kCursorImageMinorVersion    = 0x0000
  1174. };
  1175.  
  1176.  
  1177. struct CursorImageRec {
  1178.     UInt16                             majorVersion;
  1179.     UInt16                             minorVersion;
  1180.     PixMapHandle                     cursorPixMap;
  1181.     BitMapHandle                     cursorBitMask;
  1182. };
  1183. typedef struct CursorImageRec            CursorImageRec;
  1184.  
  1185. typedef CursorImageRec *                CursorImagePtr;
  1186. typedef CALLBACK_API( void , DeviceLoopDrawingProcPtr )(short depth, short deviceFlags, GDHandle targetDevice, long userData);
  1187. typedef STACK_UPP_TYPE(DeviceLoopDrawingProcPtr)                 DeviceLoopDrawingUPP;
  1188. #if OPAQUE_UPP_TYPES
  1189.     EXTERN_API(DeviceLoopDrawingUPP)
  1190.     NewDeviceLoopDrawingUPP           (DeviceLoopDrawingProcPtr userRoutine);
  1191.  
  1192.     EXTERN_API(void)
  1193.     DisposeDeviceLoopDrawingUPP       (DeviceLoopDrawingUPP    userUPP);
  1194.  
  1195.     EXTERN_API(void)
  1196.     InvokeDeviceLoopDrawingUPP       (short                    depth,
  1197.                                     short                    deviceFlags,
  1198.                                     GDHandle                targetDevice,
  1199.                                     long                    userData,
  1200.                                     DeviceLoopDrawingUPP    userUPP);
  1201.  
  1202. #else
  1203.     enum { uppDeviceLoopDrawingProcInfo = 0x00003E80 };             /* pascal no_return_value Func(2_bytes, 2_bytes, 4_bytes, 4_bytes) */
  1204.     #define NewDeviceLoopDrawingUPP(userRoutine)                     (DeviceLoopDrawingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeviceLoopDrawingProcInfo, GetCurrentArchitecture())
  1205.     #define DisposeDeviceLoopDrawingUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  1206.     #define InvokeDeviceLoopDrawingUPP(depth, deviceFlags, targetDevice, userData, userUPP)  CALL_FOUR_PARAMETER_UPP((userUPP), uppDeviceLoopDrawingProcInfo, (depth), (deviceFlags), (targetDevice), (userData))
  1207. #endif
  1208. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1209. #define NewDeviceLoopDrawingProc(userRoutine)                     NewDeviceLoopDrawingUPP(userRoutine)
  1210. #define CallDeviceLoopDrawingProc(userRoutine, depth, deviceFlags, targetDevice, userData) InvokeDeviceLoopDrawingUPP(depth, deviceFlags, targetDevice, userData, userRoutine)
  1211. /* In Carbon, use the QDGlobals accessors instead */
  1212. #if !TARGET_CARBON
  1213.  
  1214. struct QDGlobals {
  1215.     char                             privates[76];
  1216.     long                             randSeed;
  1217.     BitMap                             screenBits;
  1218.     Cursor                             arrow;
  1219.     Pattern                         dkGray;
  1220.     Pattern                         ltGray;
  1221.     Pattern                         gray;
  1222.     Pattern                         black;
  1223.     Pattern                         white;
  1224.     GrafPtr                         thePort;
  1225. };
  1226. typedef struct QDGlobals                QDGlobals;
  1227. typedef QDGlobals *                        QDGlobalsPtr;
  1228. typedef QDGlobalsPtr *                    QDGlobalsHdl;
  1229. extern QDGlobals qd;
  1230.  
  1231. #endif  /* !TARGET_CARBON */
  1232.  
  1233. EXTERN_API( void )
  1234. InitGraf                        (void *                    globalPtr)                            ONEWORDINLINE(0xA86E);
  1235.  
  1236. EXTERN_API( void )
  1237. OpenPort                        (GrafPtr                 port)                                ONEWORDINLINE(0xA86F);
  1238.  
  1239. EXTERN_API( void )
  1240. InitPort                        (GrafPtr                 port)                                ONEWORDINLINE(0xA86D);
  1241.  
  1242. EXTERN_API( void )
  1243. ClosePort                        (GrafPtr                 port)                                ONEWORDINLINE(0xA87D);
  1244.  
  1245. /*
  1246.    These are Carbon only routines. They do nothing at all on
  1247.    Mac OS 8, but work flawlessly on Mac OS X.
  1248. */
  1249. EXTERN_API( OSErr )
  1250. LockPortBits                    (GrafPtr                 port);
  1251.  
  1252. EXTERN_API( OSErr )
  1253. UnlockPortBits                    (GrafPtr                 port);
  1254.  
  1255. #if (forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32)
  1256. EXTERN_API( OSErr )
  1257. UpdatePort                        (GrafPtr                 port);
  1258.  
  1259. EXTERN_API( void *)
  1260. GetPortNativeWindow                (GrafPtr                 macPort);
  1261.  
  1262. EXTERN_API( GrafPtr )
  1263. GetNativeWindowPort                (void *                    nativeWindow);
  1264.  
  1265. EXTERN_API( void *)
  1266. MacRegionToNativeRegion            (RgnHandle                 macRegion);
  1267.  
  1268. EXTERN_API( RgnHandle )
  1269. NativeRegionToMacRegion            (void *                    nativeRegion);
  1270.  
  1271. #if TARGET_OS_WIN32
  1272. EXTERN_API( void *)
  1273. GetPortHWND                        (GrafPtr                 port);
  1274.  
  1275. EXTERN_API( GrafPtr )
  1276. GetHWNDPort                        (void *                    theHWND);
  1277.  
  1278. #define GetPortHWND(port)  GetPortNativeWindow(port)
  1279. #define GetHWNDPort(theHWND) GetNativeWindowPort(theHWND)
  1280. EXTERN_API( void *)
  1281. GetPortHDC                        (GrafPtr                 port);
  1282.  
  1283. EXTERN_API( void *)
  1284. GetPortHBITMAP                    (GrafPtr                 port);
  1285.  
  1286. EXTERN_API( void *)
  1287. GetPortHPALETTE                    (GrafPtr                 port);
  1288.  
  1289. EXTERN_API( void *)
  1290. GetPortHFONT                    (GrafPtr                 port);
  1291.  
  1292. EXTERN_API( void *)
  1293. GetDIBFromPICT                    (PicHandle                 hPict);
  1294.  
  1295. EXTERN_API( PicHandle )
  1296. GetPICTFromDIB                    (void *                    h);
  1297.  
  1298. #endif  /* TARGET_OS_WIN32 */
  1299.  
  1300. #endif  /* (forCarbon || TARGET_OS_UNIX || TARGET_OS_WIN32) */
  1301.  
  1302. #if TARGET_OS_MAC
  1303.     #define MacSetPort SetPort
  1304. #endif
  1305. EXTERN_API( void )
  1306. MacSetPort                        (GrafPtr                 port)                                ONEWORDINLINE(0xA873);
  1307.  
  1308. EXTERN_API( void )
  1309. GetPort                            (GrafPtr *                port)                                ONEWORDINLINE(0xA874);
  1310.  
  1311. EXTERN_API( void )
  1312. GrafDevice                        (short                     device)                                ONEWORDINLINE(0xA872);
  1313.  
  1314. EXTERN_API( void )
  1315. SetPortBits                        (const BitMap *            bm)                                    ONEWORDINLINE(0xA875);
  1316.  
  1317. EXTERN_API( void )
  1318. PortSize                        (short                     width,
  1319.                                  short                     height)                                ONEWORDINLINE(0xA876);
  1320.  
  1321. EXTERN_API( void )
  1322. MovePortTo                        (short                     leftGlobal,
  1323.                                  short                     topGlobal)                            ONEWORDINLINE(0xA877);
  1324.  
  1325. EXTERN_API( void )
  1326. SetOrigin                        (short                     h,
  1327.                                  short                     v)                                    ONEWORDINLINE(0xA878);
  1328.  
  1329. EXTERN_API( void )
  1330. SetClip                            (RgnHandle                 rgn)                                ONEWORDINLINE(0xA879);
  1331.  
  1332. EXTERN_API( void )
  1333. GetClip                            (RgnHandle                 rgn)                                ONEWORDINLINE(0xA87A);
  1334.  
  1335. EXTERN_API( void )
  1336. ClipRect                        (const Rect *            r)                                    ONEWORDINLINE(0xA87B);
  1337.  
  1338. EXTERN_API( void )
  1339. BackPat                            (const Pattern *        pat)                                ONEWORDINLINE(0xA87C);
  1340.  
  1341. EXTERN_API( void )
  1342. InitCursor                        (void)                                                        ONEWORDINLINE(0xA850);
  1343.  
  1344. #if TARGET_OS_MAC
  1345.     #define MacSetCursor SetCursor
  1346. #endif
  1347. EXTERN_API( void )
  1348. MacSetCursor                    (const Cursor *            crsr)                                ONEWORDINLINE(0xA851);
  1349.  
  1350. EXTERN_API( void )
  1351. HideCursor                        (void)                                                        ONEWORDINLINE(0xA852);
  1352.  
  1353. #if TARGET_OS_MAC
  1354.     #define MacShowCursor ShowCursor
  1355. #endif
  1356. EXTERN_API( void )
  1357. MacShowCursor                    (void)                                                        ONEWORDINLINE(0xA853);
  1358.  
  1359. EXTERN_API( void )
  1360. ObscureCursor                    (void)                                                        ONEWORDINLINE(0xA856);
  1361.  
  1362. EXTERN_API( void )
  1363. HidePen                            (void)                                                        ONEWORDINLINE(0xA896);
  1364.  
  1365. EXTERN_API( void )
  1366. ShowPen                            (void)                                                        ONEWORDINLINE(0xA897);
  1367.  
  1368. EXTERN_API( void )
  1369. GetPen                            (Point *                pt)                                    ONEWORDINLINE(0xA89A);
  1370.  
  1371. EXTERN_API( void )
  1372. GetPenState                        (PenState *                pnState)                            ONEWORDINLINE(0xA898);
  1373.  
  1374. EXTERN_API( void )
  1375. SetPenState                        (const PenState *        pnState)                            ONEWORDINLINE(0xA899);
  1376.  
  1377. EXTERN_API( void )
  1378. PenSize                            (short                     width,
  1379.                                  short                     height)                                ONEWORDINLINE(0xA89B);
  1380.  
  1381. EXTERN_API( void )
  1382. PenMode                            (short                     mode)                                ONEWORDINLINE(0xA89C);
  1383.  
  1384. EXTERN_API( void )
  1385. PenPat                            (const Pattern *        pat)                                ONEWORDINLINE(0xA89D);
  1386.  
  1387. EXTERN_API( void )
  1388. PenNormal                        (void)                                                        ONEWORDINLINE(0xA89E);
  1389.  
  1390. EXTERN_API( void )
  1391. MoveTo                            (short                     h,
  1392.                                  short                     v)                                    ONEWORDINLINE(0xA893);
  1393.  
  1394. EXTERN_API( void )
  1395. Move                            (short                     dh,
  1396.                                  short                     dv)                                    ONEWORDINLINE(0xA894);
  1397.  
  1398. #if TARGET_OS_MAC
  1399.     #define MacLineTo LineTo
  1400. #endif
  1401. EXTERN_API( void )
  1402. MacLineTo                        (short                     h,
  1403.                                  short                     v)                                    ONEWORDINLINE(0xA891);
  1404.  
  1405. EXTERN_API( void )
  1406. Line                            (short                     dh,
  1407.                                  short                     dv)                                    ONEWORDINLINE(0xA892);
  1408.  
  1409. EXTERN_API( void )
  1410. ForeColor                        (long                     color)                                ONEWORDINLINE(0xA862);
  1411.  
  1412. EXTERN_API( void )
  1413. BackColor                        (long                     color)                                ONEWORDINLINE(0xA863);
  1414.  
  1415. EXTERN_API( void )
  1416. ColorBit                        (short                     whichBit)                            ONEWORDINLINE(0xA864);
  1417.  
  1418. #if TARGET_OS_MAC
  1419.     #define MacSetRect SetRect
  1420. #endif
  1421. EXTERN_API( void )
  1422. MacSetRect                        (Rect *                    r,
  1423.                                  short                     left,
  1424.                                  short                     top,
  1425.                                  short                     right,
  1426.                                  short                     bottom)                                ONEWORDINLINE(0xA8A7);
  1427.  
  1428. #if TARGET_OS_MAC
  1429.     #define MacOffsetRect OffsetRect
  1430. #endif
  1431. EXTERN_API( void )
  1432. MacOffsetRect                    (Rect *                    r,
  1433.                                  short                     dh,
  1434.                                  short                     dv)                                    ONEWORDINLINE(0xA8A8);
  1435.  
  1436. #if TARGET_OS_MAC
  1437.     #define MacInsetRect InsetRect
  1438. #endif
  1439. EXTERN_API( void )
  1440. MacInsetRect                    (Rect *                    r,
  1441.                                  short                     dh,
  1442.                                  short                     dv)                                    ONEWORDINLINE(0xA8A9);
  1443.  
  1444. EXTERN_API( Boolean )
  1445. SectRect                        (const Rect *            src1,
  1446.                                  const Rect *            src2,
  1447.                                  Rect *                    dstRect)                            ONEWORDINLINE(0xA8AA);
  1448.  
  1449. #if TARGET_OS_MAC
  1450.     #define MacUnionRect UnionRect
  1451. #endif
  1452. EXTERN_API( void )
  1453. MacUnionRect                    (const Rect *            src1,
  1454.                                  const Rect *            src2,
  1455.                                  Rect *                    dstRect)                            ONEWORDINLINE(0xA8AB);
  1456.  
  1457. #if TARGET_OS_MAC
  1458.     #define MacEqualRect EqualRect
  1459. #endif
  1460. EXTERN_API( Boolean )
  1461. MacEqualRect                    (const Rect *            rect1,
  1462.                                  const Rect *            rect2)                                ONEWORDINLINE(0xA8A6);
  1463.  
  1464. EXTERN_API( Boolean )
  1465. EmptyRect                        (const Rect *            r)                                    ONEWORDINLINE(0xA8AE);
  1466.  
  1467. #if TARGET_OS_MAC
  1468.     #define MacFrameRect FrameRect
  1469. #endif
  1470. EXTERN_API( void )
  1471. MacFrameRect                    (const Rect *            r)                                    ONEWORDINLINE(0xA8A1);
  1472.  
  1473. EXTERN_API( void )
  1474. PaintRect                        (const Rect *            r)                                    ONEWORDINLINE(0xA8A2);
  1475.  
  1476. EXTERN_API( void )
  1477. EraseRect                        (const Rect *            r)                                    ONEWORDINLINE(0xA8A3);
  1478.  
  1479. #if TARGET_OS_MAC
  1480.     #define MacInvertRect InvertRect
  1481. #endif
  1482. EXTERN_API( void )
  1483. MacInvertRect                    (const Rect *            r)                                    ONEWORDINLINE(0xA8A4);
  1484.  
  1485. #if TARGET_OS_MAC
  1486.     #define MacFillRect FillRect
  1487. #endif
  1488. EXTERN_API( void )
  1489. MacFillRect                        (const Rect *            r,
  1490.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8A5);
  1491.  
  1492. EXTERN_API( void )
  1493. FrameOval                        (const Rect *            r)                                    ONEWORDINLINE(0xA8B7);
  1494.  
  1495. EXTERN_API( void )
  1496. PaintOval                        (const Rect *            r)                                    ONEWORDINLINE(0xA8B8);
  1497.  
  1498. EXTERN_API( void )
  1499. EraseOval                        (const Rect *            r)                                    ONEWORDINLINE(0xA8B9);
  1500.  
  1501. EXTERN_API( void )
  1502. InvertOval                        (const Rect *            r)                                    ONEWORDINLINE(0xA8BA);
  1503.  
  1504. EXTERN_API( void )
  1505. FillOval                        (const Rect *            r,
  1506.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8BB);
  1507.  
  1508. EXTERN_API( void )
  1509. FrameRoundRect                    (const Rect *            r,
  1510.                                  short                     ovalWidth,
  1511.                                  short                     ovalHeight)                            ONEWORDINLINE(0xA8B0);
  1512.  
  1513. EXTERN_API( void )
  1514. PaintRoundRect                    (const Rect *            r,
  1515.                                  short                     ovalWidth,
  1516.                                  short                     ovalHeight)                            ONEWORDINLINE(0xA8B1);
  1517.  
  1518. EXTERN_API( void )
  1519. EraseRoundRect                    (const Rect *            r,
  1520.                                  short                     ovalWidth,
  1521.                                  short                     ovalHeight)                            ONEWORDINLINE(0xA8B2);
  1522.  
  1523. EXTERN_API( void )
  1524. InvertRoundRect                    (const Rect *            r,
  1525.                                  short                     ovalWidth,
  1526.                                  short                     ovalHeight)                            ONEWORDINLINE(0xA8B3);
  1527.  
  1528. EXTERN_API( void )
  1529. FillRoundRect                    (const Rect *            r,
  1530.                                  short                     ovalWidth,
  1531.                                  short                     ovalHeight,
  1532.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8B4);
  1533.  
  1534. EXTERN_API( void )
  1535. FrameArc                        (const Rect *            r,
  1536.                                  short                     startAngle,
  1537.                                  short                     arcAngle)                            ONEWORDINLINE(0xA8BE);
  1538.  
  1539. EXTERN_API( void )
  1540. PaintArc                        (const Rect *            r,
  1541.                                  short                     startAngle,
  1542.                                  short                     arcAngle)                            ONEWORDINLINE(0xA8BF);
  1543.  
  1544. EXTERN_API( void )
  1545. EraseArc                        (const Rect *            r,
  1546.                                  short                     startAngle,
  1547.                                  short                     arcAngle)                            ONEWORDINLINE(0xA8C0);
  1548.  
  1549. EXTERN_API( void )
  1550. InvertArc                        (const Rect *            r,
  1551.                                  short                     startAngle,
  1552.                                  short                     arcAngle)                            ONEWORDINLINE(0xA8C1);
  1553.  
  1554. EXTERN_API( void )
  1555. FillArc                            (const Rect *            r,
  1556.                                  short                     startAngle,
  1557.                                  short                     arcAngle,
  1558.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8C2);
  1559.  
  1560. EXTERN_API( RgnHandle )
  1561. NewRgn                            (void)                                                        ONEWORDINLINE(0xA8D8);
  1562.  
  1563. EXTERN_API( void )
  1564. OpenRgn                            (void)                                                        ONEWORDINLINE(0xA8DA);
  1565.  
  1566. EXTERN_API( void )
  1567. CloseRgn                        (RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8DB);
  1568.  
  1569. EXTERN_API( OSErr )
  1570. BitMapToRegion                    (RgnHandle                 region,
  1571.                                  const BitMap *            bMap)                                ONEWORDINLINE(0xA8D7);
  1572.  
  1573. EXTERN_API( void )
  1574. DisposeRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D9);
  1575.  
  1576. #if TARGET_OS_MAC
  1577.     #define MacCopyRgn CopyRgn
  1578. #endif
  1579. EXTERN_API( void )
  1580. MacCopyRgn                        (RgnHandle                 srcRgn,
  1581.                                  RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8DC);
  1582.  
  1583. EXTERN_API( void )
  1584. SetEmptyRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8DD);
  1585.  
  1586. #if TARGET_OS_MAC
  1587.     #define MacSetRectRgn SetRectRgn
  1588. #endif
  1589. EXTERN_API( void )
  1590. MacSetRectRgn                    (RgnHandle                 rgn,
  1591.                                  short                     left,
  1592.                                  short                     top,
  1593.                                  short                     right,
  1594.                                  short                     bottom)                                ONEWORDINLINE(0xA8DE);
  1595.  
  1596. EXTERN_API( void )
  1597. RectRgn                            (RgnHandle                 rgn,
  1598.                                  const Rect *            r)                                    ONEWORDINLINE(0xA8DF);
  1599.  
  1600. #if TARGET_OS_MAC
  1601.     #define MacOffsetRgn OffsetRgn
  1602. #endif
  1603. EXTERN_API( void )
  1604. MacOffsetRgn                    (RgnHandle                 rgn,
  1605.                                  short                     dh,
  1606.                                  short                     dv)                                    ONEWORDINLINE(0xA8E0);
  1607.  
  1608. EXTERN_API( void )
  1609. InsetRgn                        (RgnHandle                 rgn,
  1610.                                  short                     dh,
  1611.                                  short                     dv)                                    ONEWORDINLINE(0xA8E1);
  1612.  
  1613. EXTERN_API( void )
  1614. SectRgn                            (RgnHandle                 srcRgnA,
  1615.                                  RgnHandle                 srcRgnB,
  1616.                                  RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8E4);
  1617.  
  1618. #if TARGET_OS_MAC
  1619.     #define MacUnionRgn UnionRgn
  1620. #endif
  1621. EXTERN_API( void )
  1622. MacUnionRgn                        (RgnHandle                 srcRgnA,
  1623.                                  RgnHandle                 srcRgnB,
  1624.                                  RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8E5);
  1625.  
  1626. EXTERN_API( void )
  1627. DiffRgn                            (RgnHandle                 srcRgnA,
  1628.                                  RgnHandle                 srcRgnB,
  1629.                                  RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8E6);
  1630.  
  1631. #if TARGET_OS_MAC
  1632.     #define MacXorRgn XorRgn
  1633. #endif
  1634. EXTERN_API( void )
  1635. MacXorRgn                        (RgnHandle                 srcRgnA,
  1636.                                  RgnHandle                 srcRgnB,
  1637.                                  RgnHandle                 dstRgn)                                ONEWORDINLINE(0xA8E7);
  1638.  
  1639. EXTERN_API( Boolean )
  1640. RectInRgn                        (const Rect *            r,
  1641.                                  RgnHandle                 rgn)                                ONEWORDINLINE(0xA8E9);
  1642.  
  1643. #if TARGET_OS_MAC
  1644.     #define MacEqualRgn EqualRgn
  1645. #endif
  1646. EXTERN_API( Boolean )
  1647. MacEqualRgn                        (RgnHandle                 rgnA,
  1648.                                  RgnHandle                 rgnB)                                ONEWORDINLINE(0xA8E3);
  1649.  
  1650. EXTERN_API( Boolean )
  1651. EmptyRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8E2);
  1652.  
  1653. #if TARGET_OS_MAC
  1654.     #define MacFrameRgn FrameRgn
  1655. #endif
  1656. EXTERN_API( void )
  1657. MacFrameRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D2);
  1658.  
  1659. #if TARGET_OS_MAC
  1660.     #define MacPaintRgn PaintRgn
  1661. #endif
  1662. EXTERN_API( void )
  1663. MacPaintRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D3);
  1664.  
  1665. EXTERN_API( void )
  1666. EraseRgn                        (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D4);
  1667.  
  1668. #if TARGET_OS_MAC
  1669.     #define MacInvertRgn InvertRgn
  1670. #endif
  1671. EXTERN_API( void )
  1672. MacInvertRgn                    (RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D5);
  1673.  
  1674. #if TARGET_OS_MAC
  1675.     #define MacFillRgn FillRgn
  1676. #endif
  1677. EXTERN_API( void )
  1678. MacFillRgn                        (RgnHandle                 rgn,
  1679.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8D6);
  1680.  
  1681. EXTERN_API( void )
  1682. ScrollRect                        (const Rect *            r,
  1683.                                  short                     dh,
  1684.                                  short                     dv,
  1685.                                  RgnHandle                 updateRgn)                            ONEWORDINLINE(0xA8EF);
  1686.  
  1687. EXTERN_API( void )
  1688. CopyBits                        (const BitMap *            srcBits,
  1689.                                  const BitMap *            dstBits,
  1690.                                  const Rect *            srcRect,
  1691.                                  const Rect *            dstRect,
  1692.                                  short                     mode,
  1693.                                  RgnHandle                 maskRgn) /* can be NULL */            ONEWORDINLINE(0xA8EC);
  1694.  
  1695. EXTERN_API( void )
  1696. SeedFill                        (const void *            srcPtr,
  1697.                                  void *                    dstPtr,
  1698.                                  short                     srcRow,
  1699.                                  short                     dstRow,
  1700.                                  short                     height,
  1701.                                  short                     words,
  1702.                                  short                     seedH,
  1703.                                  short                     seedV)                                ONEWORDINLINE(0xA839);
  1704.  
  1705. EXTERN_API( void )
  1706. CalcMask                        (const void *            srcPtr,
  1707.                                  void *                    dstPtr,
  1708.                                  short                     srcRow,
  1709.                                  short                     dstRow,
  1710.                                  short                     height,
  1711.                                  short                     words)                                ONEWORDINLINE(0xA838);
  1712.  
  1713. EXTERN_API( void )
  1714. CopyMask                        (const BitMap *            srcBits,
  1715.                                  const BitMap *            maskBits,
  1716.                                  const BitMap *            dstBits,
  1717.                                  const Rect *            srcRect,
  1718.                                  const Rect *            maskRect,
  1719.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA817);
  1720.  
  1721. EXTERN_API( PicHandle )
  1722. OpenPicture                        (const Rect *            picFrame)                            ONEWORDINLINE(0xA8F3);
  1723.  
  1724. EXTERN_API( void )
  1725. PicComment                        (short                     kind,
  1726.                                  short                     dataSize,
  1727.                                  Handle                 dataHandle)                            ONEWORDINLINE(0xA8F2);
  1728.  
  1729. EXTERN_API( void )
  1730. ClosePicture                    (void)                                                        ONEWORDINLINE(0xA8F4);
  1731.  
  1732. EXTERN_API( void )
  1733. DrawPicture                        (PicHandle                 myPicture,
  1734.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8F6);
  1735.  
  1736. EXTERN_API( void )
  1737. KillPicture                        (PicHandle                 myPicture)                            ONEWORDINLINE(0xA8F5);
  1738.  
  1739. EXTERN_API( PolyHandle )
  1740. OpenPoly                        (void)                                                        ONEWORDINLINE(0xA8CB);
  1741.  
  1742. EXTERN_API( void )
  1743. ClosePoly                        (void)                                                        ONEWORDINLINE(0xA8CC);
  1744.  
  1745. EXTERN_API( void )
  1746. KillPoly                        (PolyHandle             poly)                                ONEWORDINLINE(0xA8CD);
  1747.  
  1748. EXTERN_API( void )
  1749. OffsetPoly                        (PolyHandle             poly,
  1750.                                  short                     dh,
  1751.                                  short                     dv)                                    ONEWORDINLINE(0xA8CE);
  1752.  
  1753. EXTERN_API( void )
  1754. FramePoly                        (PolyHandle             poly)                                ONEWORDINLINE(0xA8C6);
  1755.  
  1756. EXTERN_API( void )
  1757. PaintPoly                        (PolyHandle             poly)                                ONEWORDINLINE(0xA8C7);
  1758.  
  1759. EXTERN_API( void )
  1760. ErasePoly                        (PolyHandle             poly)                                ONEWORDINLINE(0xA8C8);
  1761.  
  1762. EXTERN_API( void )
  1763. InvertPoly                        (PolyHandle             poly)                                ONEWORDINLINE(0xA8C9);
  1764.  
  1765. EXTERN_API( void )
  1766. FillPoly                        (PolyHandle             poly,
  1767.                                  const Pattern *        pat)                                ONEWORDINLINE(0xA8CA);
  1768.  
  1769. EXTERN_API( void )
  1770. SetPt                            (Point *                pt,
  1771.                                  short                     h,
  1772.                                  short                     v)                                    ONEWORDINLINE(0xA880);
  1773.  
  1774. EXTERN_API( void )
  1775. LocalToGlobal                    (Point *                pt)                                    ONEWORDINLINE(0xA870);
  1776.  
  1777. EXTERN_API( void )
  1778. GlobalToLocal                    (Point *                pt)                                    ONEWORDINLINE(0xA871);
  1779.  
  1780. EXTERN_API( short )
  1781. Random                            (void)                                                        ONEWORDINLINE(0xA861);
  1782.  
  1783. EXTERN_API( void )
  1784. StuffHex                        (void *                    thingPtr,
  1785.                                  ConstStr255Param         s)                                    ONEWORDINLINE(0xA866);
  1786.  
  1787. #if TARGET_OS_MAC
  1788.     #define MacGetPixel GetPixel
  1789. #endif
  1790. EXTERN_API( Boolean )
  1791. MacGetPixel                        (short                     h,
  1792.                                  short                     v)                                    ONEWORDINLINE(0xA865);
  1793.  
  1794. EXTERN_API( void )
  1795. ScalePt                            (Point *                pt,
  1796.                                  const Rect *            srcRect,
  1797.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8F8);
  1798.  
  1799. EXTERN_API( void )
  1800. MapPt                            (Point *                pt,
  1801.                                  const Rect *            srcRect,
  1802.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8F9);
  1803.  
  1804. EXTERN_API( void )
  1805. MapRect                            (Rect *                    r,
  1806.                                  const Rect *            srcRect,
  1807.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8FA);
  1808.  
  1809. EXTERN_API( void )
  1810. MapRgn                            (RgnHandle                 rgn,
  1811.                                  const Rect *            srcRect,
  1812.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8FB);
  1813.  
  1814. EXTERN_API( void )
  1815. MapPoly                            (PolyHandle             poly,
  1816.                                  const Rect *            srcRect,
  1817.                                  const Rect *            dstRect)                            ONEWORDINLINE(0xA8FC);
  1818.  
  1819. EXTERN_API( void )
  1820. SetStdProcs                        (QDProcs *                procs)                                ONEWORDINLINE(0xA8EA);
  1821.  
  1822. EXTERN_API( void )
  1823. StdRect                            (GrafVerb                 verb,
  1824.                                  const Rect *            r)                                    ONEWORDINLINE(0xA8A0);
  1825.  
  1826. EXTERN_API( void )
  1827. StdRRect                        (GrafVerb                 verb,
  1828.                                  const Rect *            r,
  1829.                                  short                     ovalWidth,
  1830.                                  short                     ovalHeight)                            ONEWORDINLINE(0xA8AF);
  1831.  
  1832. EXTERN_API( void )
  1833. StdOval                            (GrafVerb                 verb,
  1834.                                  const Rect *            r)                                    ONEWORDINLINE(0xA8B6);
  1835.  
  1836. EXTERN_API( void )
  1837. StdArc                            (GrafVerb                 verb,
  1838.                                  const Rect *            r,
  1839.                                  short                     startAngle,
  1840.                                  short                     arcAngle)                            ONEWORDINLINE(0xA8BD);
  1841.  
  1842. EXTERN_API( void )
  1843. StdPoly                            (GrafVerb                 verb,
  1844.                                  PolyHandle             poly)                                ONEWORDINLINE(0xA8C5);
  1845.  
  1846. EXTERN_API( void )
  1847. StdRgn                            (GrafVerb                 verb,
  1848.                                  RgnHandle                 rgn)                                ONEWORDINLINE(0xA8D1);
  1849.  
  1850. EXTERN_API( void )
  1851. StdBits                            (const BitMap *            srcBits,
  1852.                                  const Rect *            srcRect,
  1853.                                  const Rect *            dstRect,
  1854.                                  short                     mode,
  1855.                                  RgnHandle                 maskRgn)                            ONEWORDINLINE(0xA8EB);
  1856.  
  1857. EXTERN_API( void )
  1858. StdComment                        (short                     kind,
  1859.                                  short                     dataSize,
  1860.                                  Handle                 dataHandle)                            ONEWORDINLINE(0xA8F1);
  1861.  
  1862. EXTERN_API( void )
  1863. StdGetPic                        (void *                    dataPtr,
  1864.                                  short                     byteCount)                            ONEWORDINLINE(0xA8EE);
  1865.  
  1866. EXTERN_API( void )
  1867. StdPutPic                        (const void *            dataPtr,
  1868.                                  short                     byteCount)                            ONEWORDINLINE(0xA8F0);
  1869.  
  1870. EXTERN_API( void )
  1871. StdOpcode                        (const Rect *            fromRect,
  1872.                                  const Rect *            toRect,
  1873.                                  UInt16                 opcode,
  1874.                                  SInt16                 version)                            ONEWORDINLINE(0xABF8);
  1875.  
  1876. EXTERN_API( void )
  1877. AddPt                            (Point                     src,
  1878.                                  Point *                dst)                                ONEWORDINLINE(0xA87E);
  1879.  
  1880. EXTERN_API( Boolean )
  1881. EqualPt                            (Point                     pt1,
  1882.                                  Point                     pt2)                                ONEWORDINLINE(0xA881);
  1883.  
  1884. #if TARGET_OS_MAC
  1885.     #define MacPtInRect PtInRect
  1886. #endif
  1887. EXTERN_API( Boolean )
  1888. MacPtInRect                        (Point                     pt,
  1889.                                  const Rect *            r)                                    ONEWORDINLINE(0xA8AD);
  1890.  
  1891. EXTERN_API( void )
  1892. Pt2Rect                            (Point                     pt1,
  1893.                                  Point                     pt2,
  1894.                                  Rect *                    dstRect)                            ONEWORDINLINE(0xA8AC);
  1895.  
  1896. EXTERN_API( void )
  1897. PtToAngle                        (const Rect *            r,
  1898.                                  Point                     pt,
  1899.                                  short *                angle)                                ONEWORDINLINE(0xA8C3);
  1900.  
  1901. EXTERN_API( void )
  1902. SubPt                            (Point                     src,
  1903.                                  Point *                dst)                                ONEWORDINLINE(0xA87F);
  1904.  
  1905. EXTERN_API( Boolean )
  1906. PtInRgn                            (Point                     pt,
  1907.                                  RgnHandle                 rgn)                                ONEWORDINLINE(0xA8E8);
  1908.  
  1909. EXTERN_API( void )
  1910. StdLine                            (Point                     newPt)                                ONEWORDINLINE(0xA890);
  1911.  
  1912. EXTERN_API( void )
  1913. OpenCPort                        (CGrafPtr                 port)                                ONEWORDINLINE(0xAA00);
  1914.  
  1915. EXTERN_API( void )
  1916. InitCPort                        (CGrafPtr                 port)                                ONEWORDINLINE(0xAA01);
  1917.  
  1918. EXTERN_API( void )
  1919. CloseCPort                        (CGrafPtr                 port)                                ONEWORDINLINE(0xAA02);
  1920.  
  1921. EXTERN_API( PixMapHandle )
  1922. NewPixMap                        (void)                                                        ONEWORDINLINE(0xAA03);
  1923.  
  1924. EXTERN_API( void )
  1925. DisposePixMap                    (PixMapHandle             pm)                                    ONEWORDINLINE(0xAA04);
  1926.  
  1927. EXTERN_API( void )
  1928. CopyPixMap                        (PixMapHandle             srcPM,
  1929.                                  PixMapHandle             dstPM)                                ONEWORDINLINE(0xAA05);
  1930.  
  1931. EXTERN_API( PixPatHandle )
  1932. NewPixPat                        (void)                                                        ONEWORDINLINE(0xAA07);
  1933.  
  1934. EXTERN_API( void )
  1935. DisposePixPat                    (PixPatHandle             pp)                                    ONEWORDINLINE(0xAA08);
  1936.  
  1937. EXTERN_API( void )
  1938. CopyPixPat                        (PixPatHandle             srcPP,
  1939.                                  PixPatHandle             dstPP)                                ONEWORDINLINE(0xAA09);
  1940.  
  1941. EXTERN_API( void )
  1942. PenPixPat                        (PixPatHandle             pp)                                    ONEWORDINLINE(0xAA0A);
  1943.  
  1944. EXTERN_API( void )
  1945. BackPixPat                        (PixPatHandle             pp)                                    ONEWORDINLINE(0xAA0B);
  1946.  
  1947. EXTERN_API( PixPatHandle )
  1948. GetPixPat                        (short                     patID)                                ONEWORDINLINE(0xAA0C);
  1949.  
  1950. EXTERN_API( void )
  1951. MakeRGBPat                        (PixPatHandle             pp,
  1952.                                  const RGBColor *        myColor)                            ONEWORDINLINE(0xAA0D);
  1953.  
  1954. EXTERN_API( void )
  1955. FillCRect                        (const Rect *            r,
  1956.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA0E);
  1957.  
  1958. EXTERN_API( void )
  1959. FillCOval                        (const Rect *            r,
  1960.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA0F);
  1961.  
  1962. EXTERN_API( void )
  1963. FillCRoundRect                    (const Rect *            r,
  1964.                                  short                     ovalWidth,
  1965.                                  short                     ovalHeight,
  1966.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA10);
  1967.  
  1968. EXTERN_API( void )
  1969. FillCArc                        (const Rect *            r,
  1970.                                  short                     startAngle,
  1971.                                  short                     arcAngle,
  1972.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA11);
  1973.  
  1974. EXTERN_API( void )
  1975. FillCRgn                        (RgnHandle                 rgn,
  1976.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA12);
  1977.  
  1978. EXTERN_API( void )
  1979. FillCPoly                        (PolyHandle             poly,
  1980.                                  PixPatHandle             pp)                                    ONEWORDINLINE(0xAA13);
  1981.  
  1982. EXTERN_API( void )
  1983. RGBForeColor                    (const RGBColor *        color)                                ONEWORDINLINE(0xAA14);
  1984.  
  1985. EXTERN_API( void )
  1986. RGBBackColor                    (const RGBColor *        color)                                ONEWORDINLINE(0xAA15);
  1987.  
  1988. EXTERN_API( void )
  1989. SetCPixel                        (short                     h,
  1990.                                  short                     v,
  1991.                                  const RGBColor *        cPix)                                ONEWORDINLINE(0xAA16);
  1992.  
  1993. EXTERN_API( void )
  1994. SetPortPix                        (PixMapHandle             pm)                                    ONEWORDINLINE(0xAA06);
  1995.  
  1996. EXTERN_API( void )
  1997. GetCPixel                        (short                     h,
  1998.                                  short                     v,
  1999.                                  RGBColor *                cPix)                                ONEWORDINLINE(0xAA17);
  2000.  
  2001. EXTERN_API( void )
  2002. GetForeColor                    (RGBColor *                color)                                ONEWORDINLINE(0xAA19);
  2003.  
  2004. EXTERN_API( void )
  2005. GetBackColor                    (RGBColor *                color)                                ONEWORDINLINE(0xAA1A);
  2006.  
  2007. EXTERN_API( void )
  2008. SeedCFill                        (const BitMap *            srcBits,
  2009.                                  const BitMap *            dstBits,
  2010.                                  const Rect *            srcRect,
  2011.                                  const Rect *            dstRect,
  2012.                                  short                     seedH,
  2013.                                  short                     seedV,
  2014.                                  ColorSearchUPP         matchProc,
  2015.                                  long                     matchData)                            ONEWORDINLINE(0xAA50);
  2016.  
  2017. EXTERN_API( void )
  2018. CalcCMask                        (const BitMap *            srcBits,
  2019.                                  const BitMap *            dstBits,
  2020.                                  const Rect *            srcRect,
  2021.                                  const Rect *            dstRect,
  2022.                                  const RGBColor *        seedRGB,
  2023.                                  ColorSearchUPP         matchProc,
  2024.                                  long                     matchData)                            ONEWORDINLINE(0xAA4F);
  2025.  
  2026. EXTERN_API( PicHandle )
  2027. OpenCPicture                    (const OpenCPicParams *    newHeader)                            ONEWORDINLINE(0xAA20);
  2028.  
  2029. EXTERN_API( void )
  2030. OpColor                            (const RGBColor *        color)                                ONEWORDINLINE(0xAA21);
  2031.  
  2032. EXTERN_API( void )
  2033. HiliteColor                        (const RGBColor *        color)                                ONEWORDINLINE(0xAA22);
  2034.  
  2035. EXTERN_API( void )
  2036. DisposeCTable                    (CTabHandle             cTable)                                ONEWORDINLINE(0xAA24);
  2037.  
  2038. EXTERN_API( CTabHandle )
  2039. GetCTable                        (short                     ctID)                                ONEWORDINLINE(0xAA18);
  2040.  
  2041. EXTERN_API( CCrsrHandle )
  2042. GetCCursor                        (short                     crsrID)                                ONEWORDINLINE(0xAA1B);
  2043.  
  2044. EXTERN_API( void )
  2045. SetCCursor                        (CCrsrHandle             cCrsr)                                ONEWORDINLINE(0xAA1C);
  2046.  
  2047. EXTERN_API( void )
  2048. AllocCursor                        (void)                                                        ONEWORDINLINE(0xAA1D);
  2049.  
  2050. EXTERN_API( void )
  2051. DisposeCCursor                    (CCrsrHandle             cCrsr)                                ONEWORDINLINE(0xAA26);
  2052.  
  2053. /* GetCIcon(), PlotCIcon(), and DisposeCIcon() moved to Icons.h*/
  2054.  
  2055. EXTERN_API( void )
  2056. SetStdCProcs                    (CQDProcs *                procs)                                ONEWORDINLINE(0xAA4E);
  2057.  
  2058. EXTERN_API( GDHandle )
  2059. GetMaxDevice                    (const Rect *            globalRect)                            ONEWORDINLINE(0xAA27);
  2060.  
  2061. EXTERN_API( long )
  2062. GetCTSeed                        (void)                                                        ONEWORDINLINE(0xAA28);
  2063.  
  2064. EXTERN_API( GDHandle )
  2065. GetDeviceList                    (void)                                                        ONEWORDINLINE(0xAA29);
  2066.  
  2067. EXTERN_API( GDHandle )
  2068. GetMainDevice                    (void)                                                        ONEWORDINLINE(0xAA2A);
  2069.  
  2070. EXTERN_API( GDHandle )
  2071. GetNextDevice                    (GDHandle                 curDevice)                            ONEWORDINLINE(0xAA2B);
  2072.  
  2073. EXTERN_API( Boolean )
  2074. TestDeviceAttribute                (GDHandle                 gdh,
  2075.                                  short                     attribute)                            ONEWORDINLINE(0xAA2C);
  2076.  
  2077. EXTERN_API( void )
  2078. SetDeviceAttribute                (GDHandle                 gdh,
  2079.                                  short                     attribute,
  2080.                                  Boolean                 value)                                ONEWORDINLINE(0xAA2D);
  2081.  
  2082. EXTERN_API( void )
  2083. InitGDevice                        (short                     qdRefNum,
  2084.                                  long                     mode,
  2085.                                  GDHandle                 gdh)                                ONEWORDINLINE(0xAA2E);
  2086.  
  2087. EXTERN_API( GDHandle )
  2088. NewGDevice                        (short                     refNum,
  2089.                                  long                     mode)                                ONEWORDINLINE(0xAA2F);
  2090.  
  2091. EXTERN_API( void )
  2092. DisposeGDevice                    (GDHandle                 gdh)                                ONEWORDINLINE(0xAA30);
  2093.  
  2094. EXTERN_API( void )
  2095. SetGDevice                        (GDHandle                 gd)                                    ONEWORDINLINE(0xAA31);
  2096.  
  2097. EXTERN_API( GDHandle )
  2098. GetGDevice                        (void)                                                        ONEWORDINLINE(0xAA32);
  2099.  
  2100. EXTERN_API( long )
  2101. Color2Index                        (const RGBColor *        myColor)                            ONEWORDINLINE(0xAA33);
  2102.  
  2103. EXTERN_API( void )
  2104. Index2Color                        (long                     index,
  2105.                                  RGBColor *                aColor)                                ONEWORDINLINE(0xAA34);
  2106.  
  2107. EXTERN_API( void )
  2108. InvertColor                        (RGBColor *                myColor)                            ONEWORDINLINE(0xAA35);
  2109.  
  2110. EXTERN_API( Boolean )
  2111. RealColor                        (const RGBColor *        color)                                ONEWORDINLINE(0xAA36);
  2112.  
  2113. EXTERN_API( void )
  2114. GetSubTable                        (CTabHandle             myColors,
  2115.                                  short                     iTabRes,
  2116.                                  CTabHandle             targetTbl)                            ONEWORDINLINE(0xAA37);
  2117.  
  2118. EXTERN_API( void )
  2119. MakeITable                        (CTabHandle             cTabH,
  2120.                                  ITabHandle             iTabH,
  2121.                                  short                     res)                                ONEWORDINLINE(0xAA39);
  2122.  
  2123. EXTERN_API( void )
  2124. AddSearch                        (ColorSearchUPP         searchProc)                            ONEWORDINLINE(0xAA3A);
  2125.  
  2126. EXTERN_API( void )
  2127. AddComp                            (ColorComplementUPP     compProc)                            ONEWORDINLINE(0xAA3B);
  2128.  
  2129. EXTERN_API( void )
  2130. DelSearch                        (ColorSearchUPP         searchProc)                            ONEWORDINLINE(0xAA4C);
  2131.  
  2132. EXTERN_API( void )
  2133. DelComp                            (ColorComplementUPP     compProc)                            ONEWORDINLINE(0xAA4D);
  2134.  
  2135. EXTERN_API( void )
  2136. SetClientID                        (short                     id)                                    ONEWORDINLINE(0xAA3C);
  2137.  
  2138. EXTERN_API( void )
  2139. ProtectEntry                    (short                     index,
  2140.                                  Boolean                 protect)                            ONEWORDINLINE(0xAA3D);
  2141.  
  2142. EXTERN_API( void )
  2143. ReserveEntry                    (short                     index,
  2144.                                  Boolean                 reserve)                            ONEWORDINLINE(0xAA3E);
  2145.  
  2146. EXTERN_API( void )
  2147. SetEntries                        (short                     start,
  2148.                                  short                     count,
  2149.                                  CSpecArray             aTable)                                ONEWORDINLINE(0xAA3F);
  2150.  
  2151. EXTERN_API( void )
  2152. SaveEntries                        (CTabHandle             srcTable,
  2153.                                  CTabHandle             resultTable,
  2154.                                  ReqListRec *            selection)                            ONEWORDINLINE(0xAA49);
  2155.  
  2156. EXTERN_API( void )
  2157. RestoreEntries                    (CTabHandle             srcTable,
  2158.                                  CTabHandle             dstTable,
  2159.                                  ReqListRec *            selection)                            ONEWORDINLINE(0xAA4A);
  2160.  
  2161. EXTERN_API( short )
  2162. QDError                            (void)                                                        ONEWORDINLINE(0xAA40);
  2163.  
  2164. EXTERN_API( void )
  2165. CopyDeepMask                    (const BitMap *            srcBits,
  2166.                                  const BitMap *            maskBits,
  2167.                                  const BitMap *            dstBits,
  2168.                                  const Rect *            srcRect,
  2169.                                  const Rect *            maskRect,
  2170.                                  const Rect *            dstRect,
  2171.                                  short                     mode,
  2172.                                  RgnHandle                 maskRgn) /* can be NULL */            ONEWORDINLINE(0xAA51);
  2173.  
  2174. EXTERN_API( void )
  2175. DeviceLoop                        (RgnHandle                 drawingRgn,
  2176.                                  DeviceLoopDrawingUPP     drawingProc,
  2177.                                  long                     userData,
  2178.                                  DeviceLoopFlags         flags)                                ONEWORDINLINE(0xABCA);
  2179.  
  2180.  
  2181.  
  2182.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  2183.                                                                                             #pragma parameter __A0 GetMaskTable
  2184.                                                                                             #endif
  2185. EXTERN_API( Ptr )
  2186. GetMaskTable                    (void)                                                        ONEWORDINLINE(0xA836);
  2187.  
  2188.  
  2189. EXTERN_API( PatHandle )
  2190. GetPattern                        (short                     patternID)                            ONEWORDINLINE(0xA9B8);
  2191.  
  2192. #if TARGET_OS_MAC
  2193.     #define MacGetCursor GetCursor
  2194. #endif
  2195. EXTERN_API( CursHandle )
  2196. MacGetCursor                    (short                     cursorID)                            ONEWORDINLINE(0xA9B9);
  2197.  
  2198. EXTERN_API( PicHandle )
  2199. GetPicture                        (short                     pictureID)                            ONEWORDINLINE(0xA9BC);
  2200.  
  2201. EXTERN_API( long )
  2202. DeltaPoint                        (Point                     ptA,
  2203.                                  Point                     ptB)                                ONEWORDINLINE(0xA94F);
  2204.  
  2205. EXTERN_API( void )
  2206. ShieldCursor                    (const Rect *            shieldRect,
  2207.                                  Point                     offsetPt)                            ONEWORDINLINE(0xA855);
  2208.  
  2209. EXTERN_API( void )
  2210. ScreenRes                        (short *                scrnHRes,
  2211.                                  short *                scrnVRes)                            SIXWORDINLINE(0x225F, 0x32B8, 0x0102, 0x225F, 0x32B8, 0x0104);
  2212.  
  2213. EXTERN_API( void )
  2214. GetIndPattern                    (Pattern *                thePat,
  2215.                                  short                     patternListID,
  2216.                                  short                     index);
  2217.  
  2218. EXTERN_API_C( Boolean )
  2219. ptinrect                        (const Point *            pt,
  2220.                                  const Rect *            r);
  2221.  
  2222. EXTERN_API_C( void )
  2223. pt2rect                            (const Point *            pt1,
  2224.                                  const Point *            pt2,
  2225.                                  Rect *                    destRect);
  2226.  
  2227. EXTERN_API_C( void )
  2228. pttoangle                        (const Rect *            r,
  2229.                                  const Point *            pt,
  2230.                                  short *                angle);
  2231.  
  2232. EXTERN_API_C( Boolean )
  2233. ptinrgn                            (const Point *            pt,
  2234.                                  RgnHandle                 rgn);
  2235.  
  2236. EXTERN_API_C( void )
  2237. addpt                            (const Point *            src,
  2238.                                  Point *                dst);
  2239.  
  2240. EXTERN_API_C( void )
  2241. subpt                            (const Point *            src,
  2242.                                  Point *                dst);
  2243.  
  2244. EXTERN_API_C( Boolean )
  2245. equalpt                            (const Point *            pt1,
  2246.                                  const Point *            pt2);
  2247.  
  2248. EXTERN_API_C( void )
  2249. stuffhex                        (void *                    thingPtr,
  2250.                                  const char *            s);
  2251.  
  2252. EXTERN_API_C( void )
  2253. stdline                            (const Point *            newPt);
  2254.  
  2255. EXTERN_API_C( void )
  2256. shieldcursor                    (const Rect *            shieldRect,
  2257.                                  Point *                offsetPt);
  2258.  
  2259. EXTERN_API_C( long )
  2260. deltapoint                        (Point *                ptA,
  2261.                                  Point *                ptB);
  2262.  
  2263. #if OLDROUTINENAMES
  2264. #define DisposPixMap(pm) DisposePixMap(pm)
  2265. #define DisposPixPat(pp) DisposePixPat(pp)
  2266. #define DisposCTable(cTable) DisposeCTable(cTable)
  2267. #define DisposCCursor(cCrsr) DisposeCCursor(cCrsr)
  2268. #define DisposGDevice(gdh) DisposeGDevice(gdh)
  2269. #endif  /* OLDROUTINENAMES */
  2270.  
  2271. /*
  2272.     From ToolUtils.i
  2273. */
  2274. EXTERN_API( void )
  2275. PackBits                        (Ptr *                    srcPtr,
  2276.                                  Ptr *                    dstPtr,
  2277.                                  short                     srcBytes)                            ONEWORDINLINE(0xA8CF);
  2278.  
  2279. EXTERN_API( void )
  2280. UnpackBits                        (Ptr *                    srcPtr,
  2281.                                  Ptr *                    dstPtr,
  2282.                                  short                     dstBytes)                            ONEWORDINLINE(0xA8D0);
  2283.  
  2284. EXTERN_API( Fixed )
  2285. SlopeFromAngle                    (short                     angle)                                ONEWORDINLINE(0xA8BC);
  2286.  
  2287. EXTERN_API( short )
  2288. AngleFromSlope                    (Fixed                     slope)                                ONEWORDINLINE(0xA8C4);
  2289.  
  2290. /* New transfer modes */
  2291. enum {
  2292.     colorXorXFer                = 52,
  2293.     noiseXFer                    = 53,
  2294.     customXFer                    = 54
  2295. };
  2296.  
  2297. /* Custom XFer flags */
  2298. enum {
  2299.     kXFer1PixelAtATime            = 0x00000001,                    /* 1 pixel passed to custom XFer proc*/
  2300.     kXFerConvertPixelToRGB32    = 0x00000002                    /* All color depths converted to 32 bit RGB*/
  2301. };
  2302.  
  2303.  
  2304. struct CustomXFerRec {
  2305.     UInt32                             version;
  2306.     void *                            srcPixels;
  2307.     void *                            destPixels;
  2308.     void *                            resultPixels;
  2309.     UInt32                             refCon;
  2310.     UInt32                             pixelSize;
  2311.     UInt32                             pixelCount;
  2312.     Point                             firstPixelHV;
  2313.     Rect                             destBounds;
  2314. };
  2315. typedef struct CustomXFerRec            CustomXFerRec;
  2316. typedef CustomXFerRec *                    CustomXFerRecPtr;
  2317. typedef CALLBACK_API( void , CustomXFerProcPtr )(CustomXFerRecPtr info);
  2318. EXTERN_API( OSErr )
  2319. GetPortCustomXFerProc            (CGrafPtr                 port,
  2320.                                  CustomXFerProcPtr *    proc,
  2321.                                  UInt32 *                flags,
  2322.                                  UInt32 *                refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x0019, 0xAB1D);
  2323.  
  2324. EXTERN_API( OSErr )
  2325. SetPortCustomXFerProc            (CGrafPtr                 port,
  2326.                                  CustomXFerProcPtr         proc,
  2327.                                  UInt32                 flags,
  2328.                                  UInt32                 refCon)                                FOURWORDINLINE(0x203C, 0x0010, 0x001A, 0xAB1D);
  2329.  
  2330.  
  2331. enum {
  2332.     kCursorComponentsVersion    = 0x00010001
  2333. };
  2334.  
  2335. enum {
  2336.     kCursorComponentType        = FOUR_CHAR_CODE('curs')
  2337. };
  2338.  
  2339. /* Cursor Component capabilities flags */
  2340. enum {
  2341.     cursorDoesAnimate            = 1L << 0,
  2342.     cursorDoesHardware            = 1L << 1,
  2343.     cursorDoesUnreadableScreenBits = 1L << 2
  2344. };
  2345.  
  2346. /* Cursor Component output mode flags */
  2347. enum {
  2348.     kRenderCursorInHardware        = 1L << 0,
  2349.     kRenderCursorInSoftware        = 1L << 1
  2350. };
  2351.  
  2352. /* Cursor Component Info */
  2353.  
  2354. struct CursorInfo {
  2355.     long                             version;                    /* use kCursorComponentsVersion */
  2356.     long                             capabilities;
  2357.     long                             animateDuration;            /* approximate time between animate tickles */
  2358.     Rect                             bounds;
  2359.     Point                             hotspot;
  2360.     long                             reserved;                    /* must set to zero */
  2361.  
  2362. };
  2363. typedef struct CursorInfo                CursorInfo;
  2364. /* Cursor Component Selectors */
  2365. enum {
  2366.     kCursorComponentInit        = 0x0001,
  2367.     kCursorComponentGetInfo        = 0x0002,
  2368.     kCursorComponentSetOutputMode = 0x0003,
  2369.     kCursorComponentSetData        = 0x0004,
  2370.     kCursorComponentReconfigure    = 0x0005,
  2371.     kCursorComponentDraw        = 0x0006,
  2372.     kCursorComponentErase        = 0x0007,
  2373.     kCursorComponentMove        = 0x0008,
  2374.     kCursorComponentAnimate        = 0x0009,
  2375.     kCursorComponentLastReserved = 0x0050
  2376. };
  2377.  
  2378. EXTERN_API( OSErr )
  2379. OpenCursorComponent                (Component                 c,
  2380.                                  ComponentInstance *    ci)                                    FOURWORDINLINE(0x203C, 0x0008, 0x000B, 0xABE0);
  2381.  
  2382. EXTERN_API( OSErr )
  2383. CloseCursorComponent            (ComponentInstance         ci)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000C, 0xABE0);
  2384.  
  2385. EXTERN_API( OSErr )
  2386. SetCursorComponent                (ComponentInstance         ci)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000D, 0xABE0);
  2387.  
  2388. EXTERN_API( OSErr )
  2389. CursorComponentChanged            (ComponentInstance         ci)                                    FOURWORDINLINE(0x203C, 0x0004, 0x000E, 0xABE0);
  2390.  
  2391. EXTERN_API( OSErr )
  2392. CursorComponentSetData            (ComponentInstance         ci,
  2393.                                  long                     data)                                FOURWORDINLINE(0x203C, 0x0008, 0x000F, 0xABE0);
  2394.  
  2395.  
  2396. #if ACCESSOR_CALLS_ARE_FUNCTIONS
  2397. /* GrafPort */
  2398. /* Getters */
  2399. EXTERN_API( PixMapHandle )
  2400. GetPortPixMap                    (CGrafPtr                 port);
  2401.  
  2402. EXTERN_API( Rect *)
  2403. GetPortBounds                    (CGrafPtr                 port,
  2404.                                  Rect *                    rect);
  2405.  
  2406. EXTERN_API( RGBColor *)
  2407. GetPortForeColor                (CGrafPtr                 port,
  2408.                                  RGBColor *                foreColor);
  2409.  
  2410. EXTERN_API( RGBColor *)
  2411. GetPortBackColor                (CGrafPtr                 port,
  2412.                                  RGBColor *                backColor);
  2413.  
  2414. EXTERN_API( RGBColor *)
  2415. GetPortOpColor                    (CGrafPtr                 port,
  2416.                                  RGBColor *                opColor);
  2417.  
  2418. EXTERN_API( RGBColor *)
  2419. GetPortHiliteColor                (CGrafPtr                 port,
  2420.                                  RGBColor *                hiliteColor);
  2421.  
  2422. EXTERN_API( CQDProcsPtr )
  2423. GetPortGrafProcs                (CGrafPtr                 port);
  2424.  
  2425. EXTERN_API( short )
  2426. GetPortTextFont                    (CGrafPtr                 port);
  2427.  
  2428. EXTERN_API( Style )
  2429. GetPortTextFace                    (CGrafPtr                 port);
  2430.  
  2431. EXTERN_API( short )
  2432. GetPortTextMode                    (CGrafPtr                 port);
  2433.  
  2434. EXTERN_API( short )
  2435. GetPortTextSize                    (CGrafPtr                 port);
  2436.  
  2437. EXTERN_API( short )
  2438. GetPortChExtra                    (CGrafPtr                 port);
  2439.  
  2440. EXTERN_API( short )
  2441. GetPortFracHPenLocation            (CGrafPtr                 port);
  2442.  
  2443. EXTERN_API( Fixed )
  2444. GetPortSpExtra                    (CGrafPtr                 port);
  2445.  
  2446. EXTERN_API( short )
  2447. GetPortPenVisibility            (CGrafPtr                 port);
  2448.  
  2449. EXTERN_API( RgnHandle )
  2450. GetPortVisibleRegion            (CGrafPtr                 port,
  2451.                                  RgnHandle                 visRgn);
  2452.  
  2453. EXTERN_API( RgnHandle )
  2454. GetPortClipRegion                (CGrafPtr                 port,
  2455.                                  RgnHandle                 clipRgn);
  2456.  
  2457. EXTERN_API( PixPatHandle )
  2458. GetPortBackPixPat                (CGrafPtr                 port,
  2459.                                  PixPatHandle             backPattern);
  2460.  
  2461. EXTERN_API( PixPatHandle )
  2462. GetPortPenPixPat                (CGrafPtr                 port,
  2463.                                  PixPatHandle             penPattern);
  2464.  
  2465. EXTERN_API( PixPatHandle )
  2466. GetPortFillPixPat                (CGrafPtr                 port,
  2467.                                  PixPatHandle             fillPattern);
  2468.  
  2469. EXTERN_API( Point *)
  2470. GetPortPenSize                    (CGrafPtr                 port,
  2471.                                  Point *                penSize);
  2472.  
  2473. EXTERN_API( SInt32 )
  2474. GetPortPenMode                    (CGrafPtr                 port);
  2475.  
  2476. EXTERN_API( Point *)
  2477. GetPortPenLocation                (CGrafPtr                 port,
  2478.                                  Point *                penLocation);
  2479.  
  2480. EXTERN_API( Boolean )
  2481. IsPortRegionBeingDefined        (CGrafPtr                 port);
  2482.  
  2483. EXTERN_API( Boolean )
  2484. IsPortPictureBeingDefined        (CGrafPtr                 port);
  2485.  
  2486. EXTERN_API( Boolean )
  2487. IsPortOffscreen                    (CGrafPtr                 port);
  2488.  
  2489. /* Setters */
  2490. EXTERN_API( void )
  2491. SetPortBounds                    (CGrafPtr                 port,
  2492.                                  const Rect *            rect);
  2493.  
  2494. EXTERN_API( void )
  2495. SetPortOpColor                    (CGrafPtr                 port,
  2496.                                  const RGBColor *        opColor);
  2497.  
  2498. EXTERN_API( void )
  2499. SetPortGrafProcs                (CGrafPtr                 port,
  2500.                                  CQDProcs *                procs);
  2501.  
  2502. EXTERN_API( void )
  2503. SetPortVisibleRegion            (CGrafPtr                 port,
  2504.                                  RgnHandle                 visRgn);
  2505.  
  2506. EXTERN_API( void )
  2507. SetPortClipRegion                (CGrafPtr                 port,
  2508.                                  RgnHandle                 clipRgn);
  2509.  
  2510. EXTERN_API( void )
  2511. SetPortPenPixPat                (CGrafPtr                 port,
  2512.                                  PixPatHandle             penPattern);
  2513.  
  2514. EXTERN_API( void )
  2515. SetPortBackPixPat                (CGrafPtr                 port,
  2516.                                  PixPatHandle             backPattern);
  2517.  
  2518. EXTERN_API( void )
  2519. SetPortPenSize                    (CGrafPtr                 port,
  2520.                                  Point                     penSize);
  2521.  
  2522. EXTERN_API( void )
  2523. SetPortPenMode                    (CGrafPtr                 port,
  2524.                                  SInt32                 penMode);
  2525.  
  2526. EXTERN_API( void )
  2527. SetPortFracHPenLocation            (CGrafPtr                 port,
  2528.                                  short                     pnLocHFrac);
  2529.  
  2530. /* PixMap */
  2531. EXTERN_API( Rect *)
  2532. GetPixBounds                    (PixMapHandle             pixMap,
  2533.                                  Rect *                    bounds);
  2534.  
  2535. EXTERN_API( short )
  2536. GetPixDepth                        (PixMapHandle             pixMap);
  2537.  
  2538. /* QDGlobals */
  2539. /* Getters */
  2540. EXTERN_API( long )
  2541. GetQDGlobalsRandomSeed            (void);
  2542.  
  2543. EXTERN_API( BitMap *)
  2544. GetQDGlobalsScreenBits            (BitMap *                screenBits);
  2545.  
  2546. EXTERN_API( Cursor *)
  2547. GetQDGlobalsArrow                (Cursor *                arrow);
  2548.  
  2549. EXTERN_API( Pattern *)
  2550. GetQDGlobalsDarkGray            (Pattern *                dkGray);
  2551.  
  2552. EXTERN_API( Pattern *)
  2553. GetQDGlobalsLightGray            (Pattern *                ltGray);
  2554.  
  2555. EXTERN_API( Pattern *)
  2556. GetQDGlobalsGray                (Pattern *                gray);
  2557.  
  2558. EXTERN_API( Pattern *)
  2559. GetQDGlobalsBlack                (Pattern *                black);
  2560.  
  2561. EXTERN_API( Pattern *)
  2562. GetQDGlobalsWhite                (Pattern *                white);
  2563.  
  2564. EXTERN_API( CGrafPtr )
  2565. GetQDGlobalsThePort                (void);
  2566.  
  2567. /* Setters */
  2568. EXTERN_API( void )
  2569. SetQDGlobalsRandomSeed            (long                     randomSeed);
  2570.  
  2571. EXTERN_API( void )
  2572. SetQDGlobalsArrow                (const Cursor *            arrow);
  2573.  
  2574. /* Regions */
  2575. EXTERN_API( Rect *)
  2576. GetRegionBounds                    (RgnHandle                 region,
  2577.                                  Rect *                    bounds);
  2578.  
  2579. EXTERN_API( Boolean )
  2580. IsRegionRectangular                (RgnHandle                 region);
  2581.  
  2582. /* Utilities */
  2583. /* To prevent upward dependencies, GetPortWindow is defined in Window Manager interface: */
  2584. /*        pascal WindowPtr        GetPortWindow(CGrafPtr port); */
  2585. /* NewPtr/OpenCPort doesn't work with opaque structures */
  2586. EXTERN_API( CGrafPtr )
  2587. CreateNewPort                    (void);
  2588.  
  2589. EXTERN_API( void )
  2590. DisposePort                        (CGrafPtr                 port);
  2591.  
  2592. #endif  /* ACCESSOR_CALLS_ARE_FUNCTIONS */
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606. #if PRAGMA_STRUCT_ALIGN
  2607.     #pragma options align=reset
  2608. #elif PRAGMA_STRUCT_PACKPUSH
  2609.     #pragma pack(pop)
  2610. #elif PRAGMA_STRUCT_PACK
  2611.     #pragma pack()
  2612. #endif
  2613.  
  2614. #ifdef PRAGMA_IMPORT_OFF
  2615. #pragma import off
  2616. #elif PRAGMA_IMPORT
  2617. #pragma import reset
  2618. #endif
  2619.  
  2620. #ifdef __cplusplus
  2621. }
  2622. #endif
  2623.  
  2624. #endif /* __QUICKDRAW__ */
  2625.  
  2626.